Skip to content

Sleeping barber problem

A classic synchronization problem modeling one service worker, a bounded waiting room and arriving clients to illustrate mutual exclusion, blocking and coordination without lost wakeups.

Version
v1 · 2026-09-08 · History
Domain-specific #
6766
Origin domain
concurrent computing
Subdomain
synchronization problems

Core Idea

The sleeping barber problem asks how concurrent customers and a sleeping-or-working barber coordinate access to a finite-capacity shop correctly. Synchronization protects the waiting count, blocks the barber when no customers exist, wakes exactly when work arrives and rejects or redirects arrivals when all waiting chairs are full. The abstraction is therefore identified by a declared carrier, a transformation or constraint over that carrier, and an invariant that tells an analyst whether the named structure is genuinely present.

The load-bearing residual is not the broad topic of concurrent computing. It is bounded producer-consumer rendezvous framed as a service queue.

Scope of Application

Sleeping barber problem belongs to concurrent computing and is useful where the analyst can specify a barber process, barber chair, finite waiting chairs, customer processes, arrival and service events, shared counters or queue, semaphore or monitor primitives and scheduling, then evaluate at most one customer occupies the service chair, waiting capacity is respected and no wakeup or customer is lost through races. The scope is broad within that domain but bounded by the need for at most one customer occupies the service chair, waiting capacity is respected and no wakeup or customer is lost through races. The entry records a descriptive analytical identity; practical use requires the governing domain's evidence, standards, and safety obligations.

Clarity

The abstraction clarifies a crowded vocabulary by making at most one customer occupies the service chair, waiting capacity is respected and no wakeup or customer is lost through races the center of the account. A claim should name the carrier, the governing operation or relation, the applicable assumptions, and the recognition test. A bare label is insufficient because the name Sleeping barber problem can be used for a formal identity, an implementation, or a neighboring result unless carrier and convention are stated.

Manages Complexity

Without the abstraction, an analyst must reason directly over many local details: the carrier roles, admissibility assumptions, competing conventions, derived invariants, boundary cases, and proof or validation obligations specific to Sleeping barber problem. Sleeping barber problem compresses them into the roles in the structural signature. That compression permits comparison across instances without erasing the variables that determine validity. It also exposes which details may be varied safely and which are constitutive.

Abstract Reasoning

  1. Identify the carrier. State what the elements, states, objects, or observations are: a barber process, barber chair, finite waiting chairs, customer processes, arrival and service events, shared counters or queue, semaphore or monitor primitives and scheduling. Reject examples whose alleged carrier belongs to a different problem. 2. Lock the constitutive rule. Express at most one customer occupies the service chair, waiting capacity is respected and no wakeup or customer is lost through races independently of one notation or implementation.

Knowledge Transfer

Knowledge transfers strongly among subfields of concurrent computing because they reuse a barber process, barber chair, finite waiting chairs, customer processes, arrival and service events, shared counters or queue, semaphore or monitor primitives and scheduling, Synchronization protects the waiting count, blocks the barber when no customers exist, wakes exactly when work arrives and rejects or redirects arrivals when all waiting chairs are full., and type the carrier, state every parameter and convention in the definition, test that at most one customer occupies the service chair, waiting capacity is respected and no wakeup or customer is lost through races, compare the nearest accepted identity, and report counterexamples, uncertainty, and limiting cases.

Relationships to Other Abstractions

Local relationship map for Sleeping barber problemParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Sleepingbarber problemDOMAINPrime abstraction: Coordination — is a kind ofCoordinationPRIME

Current abstraction Sleeping barber problem Domain-specific

Parents (1) — more general patterns this builds on

  • Sleeping barber problem is a kind of Coordination Prime

    The proposed strict upward parent is prime:coordination.

Hierarchy paths (5) — routes to 4 parentless roots

Neighborhood in Abstraction Space

Sleeping barber problem sits in a sparse region of the domain-specific corpus (69th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Concurrency, Transactions & Process Coordination (20 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-09-08