Lab 6: The Dining Philosopher's Problem
In this lab, we consider an instance of the dining philosopher's problem implemented using PThreads. We propose and implement two solutions to this problem using the synchronization mechnanisms we have discussed in previous labs.

Issues addressed by this lab include:

Lab Materials
  1. Slides
  2. Lab Files
  3. Video Discussion



Assignment

Modify the starter code to prevent deadlock using two methods:
(1) asymmetric locking order in different philosophers and
(2) use of a Pthreads condition variable to simulate the presence of a waiter that will give both or neither of the chopsticks to a philosopher in an atomic operation.

Submission

You need to zip up your lab for submission. For this step, you should use the 'zip' target included in the lab's Makefile. Change the STUDENT_ID variable in the Makefile to your student ID and type:

    make zip

Please ensure that you have checked your final solution on the cycle servers before submission.  

Evaluation

< Back to the Lab Home Page