Question

I'm trying to build a client server application using POSIX shared memory and POSIX semaphores. Do I have to place the semaphores inside the shared memory segment or can the semaphores just be global variables? I wish to adhere to POSIX convention.

Was it helpful?

Solution

No, the semaphores are system resources; you don't have to worry about locating them.

Update: Let me "extend and revise my remarks". Named semaphores are system resources. Unnamed semaphores must be in a shared memory segment. See the intro man page for semaphores.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top