[Lazarus] semaphores [solved]

Antonio Fortuny a.fortuny at sitasoftware.lu
Thu Feb 9 09:22:35 CET 2012



Le 08/02/2012 13:52, Antonio Fortuny a écrit :
> Hi all.
>
> I need to implement a system wide locking system in all WIn32, Win64, 
> Linux32 and Linux64. Therefore I need some king of named locking objects.
> For Windows I can use mutexes. For Linex I can only use sem_t 
> structures managed by a series of functions in pthrlinux.inc but they 
> are unnamed which means that they are only usable inside a 
> multi-treaded process and not system wide.
> Something else I miss ?
>
> Antonio.
>
TEventObject in syncobjs unit does exactly the job. They are named and 
very fast, almost insignificant vs. program code.
They work across the whole system. So the resources to protect (quite 
small number) can have a named semaphore attached.
This depends on the number of free semaphores.
For now tested in Win32 and Win64.
I'll port the same application undur Linx64.

Antonio.
>
>
>
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>






More information about the Lazarus mailing list