>> 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.
