Marc Weustink ha scritto:
Razvan Adrian Bogdan wrote:
On Dec 12, 2007 12:13 PM, Marc Weustink <[EMAIL PROTECTED]> wrote:
The LCL won't be threadsafe, the overhead isn't worth the gain.
Do you think it's an overhead to use the internal locking mechanism
from GTK ?
Not only overhead in gtk widgetset, also in LCL, and aslo in all other
widgetsets.
I tend to think it's a very light mechanism that you don't even feel
in singlethreaded applications, having a threadsafe LCL means one can
freely code without any headaches from synchronization making the code
look nicer and dramatically cutting developing time,
If you start to think your design first it won't cut much.
You may think as long as you want, but if the main loop is Idle, the
synchronize method will just suspend your thread for a time which can be
unacceptable. Therefore you must create a number of kludges to overcome
the problem. This takes time, and makes the code unclean and harder to
maintain.
but i do think
it's a lot of code. I tend to think the LCLs overhead comes from using
classes too much in the lower level API abstraction part.
In all my years of delphi threadded app development I never needed
threadded updates of my gui.
This doesn't make you really qualified to discuss the topic doesn't it? ;-)
If your thread performs a side task which takes data from your main
thread, and then processes them in parallel, then of course you don't
need to deal with GUI, other than for error messages, which can be
handled quite easily. But if your threads do receive data which must be
fed to the main thread, and which must trigger visual events, then you
become aware of the strong limitations of current implementation.
Giuliano
--
Giuliano Colla
Whenever people agree with me, I always feel I must be wrong (O. Wilde)
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives