Question: The sleepy Barber Problem. A barbershop is designed so that there is a private room that contains the barber chair and an adjoining waiting room
The sleepy Barber Problem. A barbershop is designed so that there is a private room that contains the barber chair and an adjoining waiting room with a sliding door that contains N chairs (see Figure in Chapter 8). If the barber is busy, the door to the private room is closed and arriving customers sit in one of the available chairs. If a customer enters the barbershop and all chairs are occupied, the customer leaves the shop without a haircut. If there are no customers to be served, the barber goes to sleep in the barber chair with the door to the waiting room open. If the barber is asleep, the customer wakes the barber and obtains a haircut. Write a monitor to coordinate the barber and the customers.

Entrance to Waiting Room (sliding door) Shop Exit Entrance to Barber's Room (sliding door) Waiting Room
Step by Step Solution
3.27 Rating (159 Votes )
There are 3 Steps involved in it
The following code demonstrates monitor to coordinate the barber and t... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
34-E-CE-OS (467).docx
120 KBs Word File
