|
DS 7 - Semaphores
|
The proposed problem is a classical producer-consumer scheme in which there is just 1 producer and one consumer manipulating the bytes in a shared circular buffer. In particular, the shared buffer will be a an array of chars in which the producer writes one byte at a time getting it from a default string. We are going to use sem_wait and sem_post as primitives to provide semaphore functionality.
What has to be done is:
make cleanTo run your own implementation (ds7.c):
make
./prodcons
We will also discuss two extensions of this work: