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

0

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

riccardo

4 Answers

New Answer

+3

https://riptutorial.com/c/example/31715/semaphores

+5

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.

+1

thanks you very much!

0

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