Lab 5: Ring buffer
Due
Due
Two-week assignment due: November 12th, 1:20pm
Two-week assignment due: November 12th, 1:20pm
Introduction
Introduction
In this lab you'll be using pthreads to implement a producer/consumer model with a shared buffer. There will be two threads: a producer and a consumer. The producer will read information from standard input and place it into a ring buffer. The consumer will extract information from the buffer.
In this lab you'll be using pthreads to implement a producer/consumer model with a shared buffer. There will be two threads: a producer and a consumer. The producer will read information from standard input and place it into a ring buffer. The consumer will extract information from the buffer.
More details can be found in the lab writeup: https://www.cs.hmc.edu/~beth/courses/cs105/labs/ringbuffer/ringbuf.pdf.
More details can be found in the lab writeup: https://www.cs.hmc.edu/~beth/courses/cs105/labs/ringbuffer/ringbuf.pdf.
Here is the tar file that includes the writeup, 5 test input files, and 2 output files your implementation must match exactly, as described in the writeup.
https://www.cs.hmc.edu/~beth/courses/cs105/labs/ringbuffer/ringbuf.tar
Here is the tar file that includes the writeup, 5 test input files, and 2 output files your implementation must match exactly, as described in the writeup.
https://www.cs.hmc.edu/~beth/courses/cs105/labs/ringbuffer/ringbuf.tar
Submission
Submission
As described in the writeup, you should submit ringbuf.c using the following command:
As described in the writeup, you should submit ringbuf.c using the following command:
cs105submit -a 05 ringbuf.c