On Wed, 12 Dec 2007, Razvan Adrian Bogdan wrote:

> The synchronize method is simple but inefficient, it pauses your
> thread until the main thread has time to execute your code and could
> take some time until it does, i personally also dislike the fact that
> one cannot call any procedure/function with any number of parameters
> with synchronize.

That's not possible in pascal without hacking the stack.

> I think mark proposed once the solution of using a List (StringList or
> something else) in a synchronised manner with CriticalSections
> protecting access to the list and this way creating a message system
> similar to the OS one but this implementation is also not always
> comfortable but it isn't blocking as synchronize, the problem is not
> with the windows widgetset which is message based and quite thread
> safe and one can easily use CriticalSections with Controls, Borland
> started to make the VCL threadsafe but they didn't complete this task,
> maybe LCL would be more popular if it was threadsafe, i do realise
> it's a lot of work but it might be worth it.

This may work for windows, but X is not thread safe, so you would have
maybe a slightly less blocking system, but it would be blocking nonetheless.
I think the gain would be minimal. 

Michael.

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to