apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guenter Knauf <fua...@apache.org>
Subject Re: Interprocess semaphores and read/write locks
Date Fri, 02 Nov 2007 23:48:39 GMT
>> Hi Lucian,
> Just to be sure I'm interpreting this right: for this semaphore to be
> used in multiple processes it must lie in a shared memory area, isn't
> it?
no. From the docu:

sem_init
Initializes a semaphore.
Library: LibC
Classification: POSIX
Service: Synchronization
Syntax
#include <semaphore.h>
int sem_init (
sem_t *sem,
int pshared,
unsigned int value );
Parameters
sem
(IN) Points to the semaphore to initialize. Returns SEM_FAILED if the initialization fails.
pshared
(IN) Specifies whether the semaphore can be shared. This feature is unsupported on NetWare
and this parameter must be set to 0.
value
(IN) Specifies the number of resources that the semaphore can protect and control.
Return Values
If successful, returns zero; otherwise, returns -1 and sets errno to one of the following
values:

Guen.



Mime
View raw message