posix named semaphore value not reflected across process

posix named semaphore value not reflected across process

Post by Abhij » Wed, 13 Nov 2002 02:30:09



Platform: Solaris 2.8
I do the following:
1)created posix named semaphore using sem_open(...) , and a value = 3
2)did a sem_wait().
3)check the semaphore value, which is 2.
4)Just stop executing, by waiting for user input. (The semaphore
has not been closed of uninked)
This is all fine.

Then I start another instant of the same prog.
This does the sem_open (to the exisitng semaphore).
The sempahore value now is 3 again. It should have been 2. (because
sem_wait(..) from the first instant has already decrements the value
to 2)

Looks like the semaphore is not working across process !!!

Any sugesstions , please.
Thanks
Abhijit