[Lazarus] semaphores [solved]

Antonio Fortuny a.fortuny at sitasoftware.lu
Thu Feb 9 10:53:30 CET 2012



Le 09/02/2012 10:36, Michael Schnell a écrit :
> On 02/09/2012 09:22 AM, Antonio Fortuny wrote:
>>
>>
>> TEventObject in syncobjs unit does exactly the job.
>
> The documentation on TEventObject suggest that it is for synchronizing 
> multiple threads of a single process and not for synchronizing 
> multiple independently running processes.
I've made a test on Win32 and the TEventObject is blocking system wide. 
Three instances af the same program are running (which means three 
independent processes) using the same named TEventObject. The first 
acquiring te event locks it for the two other whichever is the blocking 
process. This means that the TEventObject uses is managed by the OS at 
the kernel level.
I'll port the name test on WIN64 and Linux64 to see what happens.
The documentation says:
"/Other threads that wish to be notified of these events should create 
their own instances of TEventObject with the same name, and wait for 
events to arrive/." which in turn suggests that any thread insterested 
in a names event must have its own instance of the object
Anyway, it appears to work.

Antonio.

>
> -Michael
>
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120209/81dc27b7/attachment-0003.html>


More information about the Lazarus mailing list