CS520
Spring 2018
Laboratory 9
Friday April 6
The lab must be submitted prior to 12noon on Sunday April 8.


Test your implementation of a concurrent buffer with a single "producer" and a single "consumer" thread.

For your testing, use the main program available on agate in ~cs520/public/lab9/countChars.c. There is also a Makefile in this directory that shows how to compile this program with your code for the concurrent buffer facility. (Note that when compiling programs that use POSIX threads, you must use the gcc switch "-pthread".)

Use the valgrind memcheck facility to validate that you properly free all allocated memory blocks:

Also run the program using the valgrind helgrind facility to check for threading errors:

Points will be awarded in the following manner:

Turn in this laboratory by typing:

% ~cs520/bin/submit lab9 concurrentBuffer.c

Submissions can be checked by typing:

% ~cs520/bin/scheck lab9

Remember that there are no late submissions of labs. Submit what you have prior to 12noon on Sunday April 8. Be careful: one minute late is late.


Last modified on February 8, 2018.

Comments and questions should be directed to pjh@cs.unh.edu