Where do you place POSIX semaphores when using POSIX shared memory?

I am trying to create a client server application using POSIX shared memory and POSIX semaphores. Should I place semaphores inside a shared memory segment or can semaphores be global variables? I want to stick to the POSIX convention.

+3
source share
1 answer

No, semaphores are system resources; You don’t need to worry about finding them.

Update: Let me "extend and revise my comments." Named semaphores are system resources. Untitled semaphores should be in a shared memory segment. See the intro page for semaphores .

+5
source

Source: https://habr.com/ru/post/1708444/


All Articles