Kyle-Pu / Prodco

A solution to the producer consumer problem in C.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Producer Consumer

An interactive, command-line producer-consumer (bounded buffer) simulation written in C. Logs all actions and buffer status on each action (producing or consuming).

Building

Clone this repository and run make in the repo's directory. Note that the semaphores used here are deprecated on OS X.

Running

./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

Resources and References

  1. Learn about Makefiles
  2. Mutex Lock Examples
  3. What're all those weird symbols in the Makefile?
  4. On Makefile debugging

C Syntax Aside

  • -> has higher precedence than &

About

A solution to the producer consumer problem in C.


Languages

Language:C 96.2%Language:Makefile 3.8%