CS 110 Operating Systems
Priority Barber Shop Project
Necessary for a Grade of A, but NOT Sufficient
Version 0.9
Due Date - 1 December, 9PM
NO LATES

Introduction

This is a modification of the solution to Basic Barber Shop Project (semaphores, shared memory, and multilevel queues). The Barber Shop operation has been reported to the Inspector General. It seems in its current instantiation, starvation is possible, i.e., Grunts can wait all day for haircuts because Officers and NonComs have priority. In an effort to keep the Grunts happy and the IG off your tail, you have decided to modify your queue and priority system. Now Grunts are guaranteed to have their priority increased in the following way.

In order to handle this mess, the Barber Shop has changed its queueing system. There are still a max of 20 chairs. People are managed in chairs by setting priorities associated with the chair. For example, if a Grunt enters in chair 11, he can be viewed as having priority 0 (Grunt level) and in a FIFO queue of Grunts. When he is moved because of slow processing to the NonCom level, the Grunt is still in chair 11, but now has priority 1 (NonCom level) and in a FIFO queue of NonComs. When he is moved because of slow processing to the Officer level, the Grunt is still in chair 11, but now has priority 2 (Officer level) and in a FIFO queue of Officers.

Hair cuts still take the time as found in the input stream.

Implementation Notes:

  • Due Dates:

    Dec 1, 9PM

    What to Turn-In:

    Where to Turn-In:

    To the plastic bin outside Professor Erlinger's office.

    References:

    Notes:

    I reserve the right to change the problem statement when someone demonstrates the ambiguity of said problem statement.

    Last modified Dec 2, 01 by mike@cs.hmc.edu