Sleeping Barber Problem
Updated 2026-07-28
Summary
In computer science, the sleeping barber problem is a classic inter-process communication and synchronization problem that illustrates the complexities that arise when there are multiple operating system processes.
Definition
In computer science, the sleeping barber problem is a classic inter-process communication and synchronization problem that illustrates the complexities that arise when there are multiple operating system processes. The problem was originally proposed in 1965 by computer science pioneer Edsger Dijkstra, who used it to make the point that general semaphores are often superfluous.
Introduction
How to use
In computer science, the sleeping barber problem is a classic inter-process communication and synchronization problem that illustrates the complexities that arise when there are multiple operating system processes.
Mechanism
A classic concurrency synchronization problem in operating systems: how to coordinate customer arrivals, waiting, and wake-up when the barber is asleep or busy, demonstrating inter-process synchronization, mutual exclusion, and avoidance of deadlock and starvation.
Practice
In progress 0/3Practice this model in one real situation:
Cases
- In a thread pool, workers sleep when idle and are woken up when tasks arrive; service rate limiting and queueing.
Common pitfalls
- Ignoring lost wakeups can lead to permanent sleep or starvation; improper lock granularity can cause poor performance.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- en.wikipedia.orghttps://en.wikipedia.org/wiki/Sleeping_barber_problemverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS