Skip to content
Producer-consumer problem solution using semaphore and mutex
C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
output.png
producer-consumer.c

README.md

Multi Prodcuer-Consumer Problem Solution Using Semaphore and Mutex

Blog: https://shivammitra.com/c/producer-consumer-problem-in-c

The producer-consumer problem is one of the classical examples of synchronization. This program simulates a multi producer-consumer problem in C.

Compiling the program: gcc producer-consumer.c -pthread

Running the program: ./a.out

Output

output

You can’t perform that action at this time.