[Lazarus] semaphores

Hans-Peter Diettrich DrDiettrich1 at aol.com
Tue Feb 14 11:48:14 CET 2012


Lukasz Sokol schrieb:

> System-wide solutions for Linux is the *Unix-way*, is to create a lock-file;
> If you create one on a tmpfs mounted directory, it will all happen in 
> memory, hence no hard-drive storage access will happen (unless moved to swap, 
> but in your case it won't ever happen) so all you need to do is check for 
> lock file existence.

How to use such an file?

Does it have to be created to indicate a lock, and deleted again when done?

Or is obtaining exclusive (r/w) access to the file equivalent to 
obtaining the lock?

The latter looks the right way to me, because then the lock will be 
removed by the system on termination of the owning process, be regular 
or aborted.

DoDi





More information about the Lazarus mailing list