[Lazarus] semaphores

waldo kitty wkitty42 at windstream.net
Thu Feb 9 19:11:34 CET 2012


On 2/9/2012 03:17, Antonio Fortuny wrote:
>
>
> Le 08/02/2012 19:56, waldo kitty a écrit :
>> On 2/8/2012 07:52, Antonio Fortuny wrote:
>>> 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 ?
>>
>> the old school simple solution is to just use a file... no need to get
>> fancy... if the file exists or not is all you need to worry about :)
> Read my remark just above.

i did and using a file as a semaphore to (b)lock or not seems fine... i use file 
semaphores in my stuff on numerous OS' and across numerous languages and 
scripting formats...





More information about the Lazarus mailing list