In the world of computers, a sleeping barber problem is the fanciful name used to identify a situation in which processes are currently in a holding pattern while awaiting resources to reach some type of resolution. The reference to the sleeping barber has to do with the lack of productivity that a barber experiences when there are no customers in the shop awaiting a haircut. This plays on the old stereotype of a barber who is asleep in his chair until a customer comes through the door seeking a haircut. According to this analogy, the barber immediately awakes from his slumber when roused by a customer, provides the haircut and promptly goes back to sleep once the customer is out the door, only to awaken when the next customer comes enters. In terms of computer function, this relates to resources that are in a dormant state until needed for a process, and then slip back into that same state until the next process is initiated, creating a lag time between processes that could lower overall efficiency.
The imagery used to describe the sleeping barber problem has to do with a barber who has only an occasional customer, usually finishing with one before the next customer arrives, or at least gets to the second customer with only a minimum amount of waiting. As long as the number of customers waiting in the queue is kept to a minimum and no one gets impatient and walks out, it can be said there is no problem and the lone barber is keeping up with the demand. At the same time, if the shop becomes inundated with customers requesting haircuts but the barber is already engaged, then there is a high likelihood that some of those customers will not wait and will leave.
The same type of sleeping barber problem can be seen with various types of processing situations involving computer technology that is in need of some sort of upgrade in order to handle an increase in demand. For example, if the call center for a company is inundated with inbound calls from customers who want help now, but the number of customer service representatives is not sufficient to keep up with the demand, then a portion of those customers will abandon their calls and possibly seek a relationship with a competitor. In like manner, within the processing systems of a computer network, if the resources devoted to the timely processing of tasks are insufficient for the number of tasks involved, some of those processes will incur what is known as a time-out, and possibly even terminate. The end result is a loss of efficiency that can in turn slow down other processes that were scheduled to follow the ones that timed out.
There is no one right way to managing a sleeping barber problem. Depending on the configuration of the computer equipment used, there may be ways to implement new approaches that help to reallocate resources so that tasks may be managed with greater efficiency. For example, reconfiguring the auto attendant services for a call center could result in saving time by automatically routing the next call in the waiting queue to a representative without the need for that representative to manually pick up another pending line. Just as adding additional barbers to a shop make it easier to handle customers seek a haircut, adding more resources in terms of inbound lines and customer service workstations to handle the call volume would also make it easier to handle the volume without triggering a lot of delays. In like manner, expanding resources on a network to support additional functions and processes may also help to minimize a sleeping barber problem and allow the system to operate more efficiently.