Semaphores in libc

Luciano Rocha strange@nsk.no-ip.org
Thu Dec 31 12:31:00 GMT 2009


On Thu, Dec 31, 2009 at 11:38:12AM +0000, Paulo J. Matos wrote:
> Hi all,
> 
> I am trying to find a solution for the following problem: I have a
> code region in C that should only be accessed by one process at a
> time. I have basically multiple instances of this program running but
> that bit of code, only one of the instances can be running it at that
> point.
> 
> Everywhere I look I seem to find solutions for thread-based software
> etc, which is not this case.
> I thought a mutex should do it but I can't find the bit of the manual
> that actually confirms mutexes are the way to go.

POSIX semaphores, do: man sem_overview.

-- 
lfr
0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-help/attachments/20091231/e22bc334/attachment.sig>


More information about the Libc-help mailing list