Docsity

Operating Systems Assignment: Solving the Dining Philosophers Problem using POSIX API, Assignments of Operating Systems

Toggle sidebar
bg1
CMSI 387
OPERATING SY S T E M S
Spring 2009
Assignment 0409
This assignment is yet another “classic” operating systems programming task dealing with process synchro-
nization, supported by a smattering of exercises.
Not for Submission
We are still very much within chapter 6 of SGG.
For Submission
The Dining Philosophers Problem
Implement a solution to the dining philosophers
problem using the POSIX API. The bounded
buffer code given out in class may be used as a ba-
sis for your solution.
Make sure to include well-placed output statements
to report what’s happening in your program and
the state of things at any given time — that’s how
we’ll know whether your solution is working.
Commit your code to /homework/cmsi387/dp.
Exercises
Do the following exercises from SGG: 6.9 and
6.27. Hint: The answer to 6.27 can be found in one
of the “classic papers” given out in class.
Plus, name two things (for a total of four observa-
tions) that may happen in incorrect critical section
solutions to the dining philosophers and sleeping
barber (SGG Exercise 6.39) problems.
Submit your answers on hardcopy.
Extra Credit
The Sleeping-Barber Problem
You will get extra credit if you also implement a
solution to the sleeping barber problem (SGG Ex-
ercise 6.39). Commit this to /homework/cmsi387/sb.

Partial preview of the text

Download Operating Systems Assignment: Solving the Dining Philosophers Problem using POSIX API and more Assignments Operating Systems in PDF only on Docsity!

CMSI 387

O P E R A T I N G S Y S T E M S

Spring 2009

Assignment 0409

This assignment is yet another “classic” operating systems programming task dealing with process synchro- nization, supported by a smattering of exercises.

Not for Submission

We are still very much within chapter 6 of SGG.

For Submission

The Dining Philosophers Problem

Implement a solution to the dining philosophers problem using the POSIX API. The bounded buffer code given out in class may be used as a ba- sis for your solution. Make sure to include well-placed output statements to report what’s happening in your program and the state of things at any given time — that’s how we’ll know whether your solution is working. Commit your code to /homework/cmsi387/dp.

Exercises

Do the following exercises from SGG: 6.9 and 6.27. Hint: The answer to 6.27 can be found in one of the “classic papers” given out in class. Plus, name two things (for a total of four observa- tions) that may happen in incorrect critical section solutions to the dining philosophers and sleeping barber (SGG Exercise 6.39) problems. Submit your answers on hardcopy.

Extra Credit

The Sleeping-Barber Problem

You will get extra credit if you also implement a solution to the sleeping barber problem (SGG Ex- ercise 6.39). Commit this to /homework/cmsi387/sb.