Laboratory Exercises For Computer Science 213

Lab on Deadlock and Starvation

Lab on Deadlock and Starvation

Goals: This lab provides practice considering alternative approaches to avoid deadlock and starvation when writing programs involving multiple processes.

Resources:

Steps for this Lab:
  1. Working in groups of 2 or 3, write out answers to exercise 6.14 (a and b) from the textbook. Then identify at least one way to modify the proposed solution to the Dining Philosophers Problem which prevents both deadlock and starvation. Your solution also should allow multiple philosophers to eat concurrently (at least some times), assuming that there are more than 3 philosophers altogether.

  2. Still working in groups, outline a solution to the Fraternity/Sorority Party problem. In particular, identify any needed semaphores and shared variables, and write pseudo-code to show which processes will access which of these resources when.


Work to be turned in:


This document is available on the World Wide Web as

     http://www.math.grin.edu/~walker/courses/213.fa98/lab-deadlock.html

created October 27, 1998
last revised October 28, 1998