How can I create a semaphore in C? | Sololearn: Learn to code for FREE!


How can I create a semaphore in C?

Hi, I have to create a semaphore that let me put in pause a process called “Player” and, after that the father process has finished some operations, it should signal to the player to continue his execution.

1/6/2020 5:05:11 PM


4 Answers

New Answer



Standard C does not support threads so semaphores are not needed. Given you are using some non standard thread support, you must specify it so we might be able to answer your question.


thanks you very much!


I use unix based system like linux or MacOs, in the header I put #include<sys/sem.h> #include<sys/shm.h>