Operating System - HP-UX
1836581 Members
1733 Online
110102 Solutions
New Discussion

memory mapped semaphores and SG

 
Stefan Hirsch_2
Occasional Advisor

memory mapped semaphores and SG

Hi *,

we are using memory mapped semaphores for processes which are running in a ServiceGuard package. The files containing the semaphores are on a disk which is mounted wherever the package runs. During failover of the package the first process is sometimes unable to lock the semaphore although no other process is holding the lock. The msemaphore structures in the file is not corrupted as far as we can see. At least unlocking works if copying the file to another server. Now I'm wondering about following snippet from the msem_lock man page:

to msem_lock() and msem_unlock(), the results are undefined. The
address of an msemaphore uniquely identifies the semaphore. If the
msemaphore structure contains any value copied from an msemaphore
structure at a different address, the result is undefined.

Could this mean that copying or mounting a file
containing a msemaphore is the equivalent of copying it from one memory region to another?

BR
Stefan Hirsch