The sleepy Barber Problem. A barbershop is designed so that there is a private room that contains

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 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.

image

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: