Skip to content

Concurrency Control

Coordinate simultaneous processes so they can proceed in parallel without corrupting shared state, over-claiming shared resources, or blocking one another indefinitely.

The Diagnostic Story

Symptom: Multiple actors are working at the same time on the same resources or shared state, and the results depend on who gets there first. Updates overwrite each other silently, the same resource gets claimed twice, contradictory decisions are both applied, and occasional deadlocks freeze progress entirely. Whether an action succeeds or corrupts something has become a matter of timing rather than logic.

Pivot: The source of the problem is that parallel activity without coordination exposes shared surfaces to interference. The structural move is to map the shared surfaces, classify where conflict can occur, and apply the weakest sufficient combination of partitioning, ordering, isolation, or admission control that preserves safe parallel progress—not eliminating concurrency but making it governable.

Resolution: Shared state stays internally consistent and shared resources are not double-allocated. Parallel progress continues wherever conflict is absent, and where conflict occurs it is resolved through visible, accountable rules rather than timing luck. Contention hot spots become observable rather than mysterious.

Reach for this when you hear…

[database engineer] “We had two transactions both read the same inventory count as 1, both decided to sell it, and now we've oversold a product that doesn't exist.”

[clinical scheduling] “Three coordinators can all see the same open slot and book it simultaneously—we need the system to lock a slot the moment someone starts filling it in.”

[budget operations] “Two departments both drew from the contingency fund at the same time and neither knew the other had; the total exceeded the reserve before anyone noticed.”

Mechanisms / Implementations

  • Collaborative Editing Protocol
  • Deadlock Timeout and Detection
  • Facilitated Turn-Taking
  • Merge Conflict Review
  • Mutex or Lock
  • Optimistic Concurrency Check: Lets writers proceed without locks by stamping each record with a version and rejecting any write whose expected version no longer matches — catching the lost update instead of preventing it.
  • Ownership Assignment Matrix
  • Reservation Calendar
  • Semaphore or Permit System
  • Transaction Isolation: Defines which concurrency anomalies a multi-operation transaction is protected from by naming an isolation level and the set of interleavings it rules out.

Abstractions this archetype builds on — directly (a source ingredient) or as a related pattern. Links follow the typed catalog namespace.

Built directly on (3)

Also references 10 related abstractions

Variants

Narrower or domain-specific specializations that share this archetype's core structure. Recognized variants are established; candidate variants are provisional.

Conflict-Free Parallelism · subtype · merge review

Structure work so parallel actions do not contend for the same state, resource, or decision surface.

Race Condition Prevention · risk or failure variant · candidate

Prevent outcomes from depending on accidental timing between concurrent actions.

Serialized Access Coordination · subtype · recognized

Make a contested resource safe by routing access through an explicit sequence.

Optimistic Concurrency Control · implementation variant · recognized

Allow concurrent work to proceed tentatively, then validate before committing or require retry when conflicts appear.

Collaborative Concurrency Protocol · domain variant · recognized

Coordinate simultaneous human work on shared artifacts, decisions, spaces, or responsibilities.