An interactive, command-line producer-consumer (bounded buffer) simulation written in C. Logs all actions and buffer status on each action (producing or consuming).
Clone this repository and run make
in the repo's directory. Note that the semaphores used here are deprecated on OS X.
./ProducerConsumer BUFFER_SIZE NUM_PRODUCERS NUM_CONSUMERS
- e.g.
./ProducerConsumer 10 15 8
creates a buffer of size limit 10 with 15 producer threads and 8 consumer threads
- Learn about Makefiles
- Mutex Lock Examples
- What're all those weird symbols in the Makefile?
- On Makefile debugging
->
has higher precedence than&