Michael Schnell <[email protected]> hat am 9. Juni 2011 um 10:50 geschrieben:
> On 06/08/2011 05:39 PM, Henry Vermaak wrote:
> >> There is no chance for deadlock with main thread calling this from
> >> inside another thread?
> >
> >
> > You have to protect it with a critical section (if you have more than
> > one thread calling QueueAsyncCall).
>
> A critical section likely will kill the thread latency, so this should
> be avoided
How many calls per second do you want to execute via the main thread?
QueueAsyncCall is *not* thread safe. If QueueAsyncCall should be made thread
safe, then TApplication must be extended to use a critical section for it (or
some lock-free queue, but since we are talking about the GUI thread, latency is
already so bad, that this makes no difference).
Afaik all PostMessages implementations use a critical section. So you don't need
to do that yourself.
>[...]
Mattias
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus