ENCYCLOPEDIA 4U .com



Encyclopedia Home Page

Google
  Web Encyclopedia4u.com

 

Sleeping barber problem

In computer science, the sleeping barber problem is a synchronization problem. The problem revolves around a barber shop that has one barber, one barber chair, and several waiting chairs. When there are no customers, the barber sits in his chair and sleeps. As soon as a customer arrives, he either awakens the barber or if the barber is cutting someone's hair, he sits down on one of the waiting chairs (or he leaves if the waiting chairs are all occupied). The problem consists of engaging in the activity without any race conditions. The solution involves using semaphores and mutexes to guard the critical region.

See also





Content on this web site is provided for informational purposes only. We accept no responsibility for any loss, injury or inconvenience sustained by any person resulting from information published on this site. We encourage you to verify any critical information with the relevant authorities.



Copyright © 2005 Par Web Solutions All Rights reserved.
| Privacy

This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Sleeping barber problem".