CS 470 - Operating Systems
Spring 2008 - Thread Synchronization Project

40 points
Out: February 15, 2008
Due: March 10, 2008 (Monday after spring break)


The purpose of this project is provide experience with Pthreads and (thread) synchronization.


Problem Statement

Complete the producer-consumer project described on pages 236-240 in the textbook using Pthreads. In this project, there may be multiple producers and consumers accessing a bounded buffer, each of which is running in a thread. Differences from the producer-consumer processes with shared memory and semaphores example given in class include:



Assignment

(20 points) Implementation. This project may be done in individually or in pairs (group of 2). This project may be written in any language as long as it uses Pthreads and runs on csserver. Provide a makefile that will make your project, if needed. Recall that when compiling a Pthread program using gcc or g++ that you must include the command-line option: -lpthread


(10 points) Provide a high-level functional analysis and design of the program describing the functionality of the major components of the program and how they interact with each other. If the program does not meet all of the project requirements, describe which parts are missing and what you think should be done to implement them.


(10 points) In addition, answer the following questions:


  1. What aspect of thread manipulation did you find most difficult to understand?

  2. What aspect of thread manipulation did you find least difficult to understand?

  3. What aspect of thread synchronization did you find most difficult to understand?

  4. What aspect of thread synchronization did you find least difficult to understand?

  5. What, if anything, would you change in your current design?

  6. What, if anything, did you find interesting or surprising about thread manipulation or thread synchronization that you did not know before doing this project?


What to Submit

Submit items no later than 4:30pm on the due date.


Create a tarfile containing the source code and makefile for the project. Submit this tarfile electronically by emailing it as an attachment to the instructor.


Submit the following items in hardcopy:


02/14/08 2 of 2