producer/consumer code (working)
This commit is contained in:
@@ -24,6 +24,25 @@ prompt> make
|
||||
prompt> ./binary
|
||||
```
|
||||
|
||||
# Producer/Consumer
|
||||
|
||||
Code for the working producer/consumer solution from the text,
|
||||
found in `producer_consumer.c`.
|
||||
|
||||
Run `make` to build, and `producer_consumer` to test it.
|
||||
The program takes a few different arguments:
|
||||
- The number of buffers between the producer/consumer
|
||||
- The number of times a producer should produce something
|
||||
- The number of consumer threads
|
||||
|
||||
```sh
|
||||
prompt> make
|
||||
prompt> ./producer_consumer 1 1000 1
|
||||
```
|
||||
|
||||
The output should print each produced item once, and show which
|
||||
consumer consumed each produced item.
|
||||
|
||||
|
||||
# Dining Philosophers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user