<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
Le 14/02/2012 10:32, Lukasz Sokol a écrit :
<blockquote cite="mid:jhd9n7$q24$1@dough.gmane.org" type="cite">
<pre wrap="">On 14/02/2012 08:43, Antonio Fortuny wrote:
Hello Antonio,
</pre>
<blockquote type="cite">
<pre wrap="">Linux ? I'm still looking for a solution equivalent to the Windows
mutexes. Events seem to be local to a process. Semaphores could be a
solution but with Lazarus 0.9.31 on an OpenSuse 11.4 64 bit,
semaphores can only be used unnamed (*sem_init* function is
available) because function *sem_open* is not defined, only on DARWIN
OS. The problem with a file is that I don't know how to use it as a
semaphore with the above constraints. The problem looks like a token
problem.
Antonio.
</pre>
</blockquote>
<pre wrap="">
System-wide solutions for Linux is the *Unix-way*, is to create a lock-file;</pre>
</blockquote>
Got it.<br>
<blockquote cite="mid:jhd9n7$q24$1@dough.gmane.org" type="cite">
<pre wrap="">
If you create one on a tmpfs mounted directory, </pre>
</blockquote>
What do you call a "<big>tmpfs mounted directory</big>" ? I'm only a
pascal programmer not a system guy<br>
<blockquote cite="mid:jhd9n7$q24$1@dough.gmane.org" type="cite">
<pre wrap="">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.</pre>
</blockquote>
Does it mean that every process will have to create the file ? An
open-close sequence checking the IOResult would be enough ?<br>
<blockquote cite="mid:jhd9n7$q24$1@dough.gmane.org" type="cite">
<pre wrap="">
(IMHO)
There is also futex (Fast Userspace muTEX) but I don't know much about that one;
<a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/Futex">http://en.wikipedia.org/wiki/Futex</a>
HTH.
L.
--
_______________________________________________
Lazarus mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
</pre>
</blockquote>
</body>
</html>