/barberproblem

Problem: Write a multithreaded program that solves the sleeping barber problem as described below. The barber shop has one barber, one barber chair, and n chairs for waiting customers, if any, to sit on. If there are no customers present, the barber sits down in the barber chair and falls asleep. When a customer arrives and the barber is sleeping, s/he has to wake up the sleeping barber. If additional customers arrive while the barber is cutting a customer’s hair, they either sit down (if there are empty chairs) or wait for the empty chairs (if all chairs are full). The problem is to program the barber and the customers without getting into race conditions. Your program must prompt user for the number of customers and the number of chairs in the waiting room. You can assume that the maximum number of customers is 25.

Primary LanguageC++

Watchers