[Lazarus] PostMessage return value

Xiangrong Fang xrfang at gmail.com
Mon Sep 15 14:55:23 CEST 2014


2014-09-15 20:34 GMT+08:00 Sven Barth <pascaldragon at googlemail.com>:

> If you want to use a separate thread ("dispatcher") for enqueueing new
> work you should create an event that you pass to this thread and the worker
> threads. The dispatcher waits on the event and the worker threads will
> signal the event once they are done. Of course you'll likely also signal
> the event when new work items are queued that need to be dispatched.
>
In Michael's previous email, I understand that using PostMessage and
QueueAsyncCall will does the same thing.

How do I use Event to achieve the same? It seems that I can have N threads
"listen" to the same event, but cannot have the main thread to "listen" to
N different events?

Anyway, if I use Event I'll do some more reading of the document. For now,
I would like to know, performance-wise, which way is better? Using
QueueAsyncCall/PostMessage or RTLEvent*?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140915/9b22898e/attachment-0003.html>


More information about the Lazarus mailing list