ALL > Computer and Education > courses > university courses > undergraduate courses > Operating System > CLASS (2016-2017-1)-62903-06102-1 > 2014329620056-renyajie > homework4_6.11 >
The Sleeping-Barber Problem Version 0
👤 Author: by x20056 2016-11-08 18:29:09
#include
using namespace std;

/**
Requirement:
1. If there are no customers to be served, the barber goes to sleep
2. If a customer enter the barbershop and all chairs are occupied, then leave.
3. If the barber is busy but the chairs are available, then the customer sits in one of the free chairs.
4. If the barber is asleep, the customer wakes up the barber.
**/

enum{
BUSY,
ASLEEP,
AVAILABLE
};

//chair: to identify whether waiting chair is available
//barberCha

Please login to reply. Login

Reversion History

Loading...
No reversions found.