Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 915
Anonymous Avatar asked Dec 13 '25 04:12

Anonymous


1 Answers

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.

like image 148
Charlie Martin Avatar answered Dec 15 '25 03:12

Charlie Martin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!