Infrastructure · Primitives

Mutex

Ownership-based mutual exclusion

Definition

Mechanism

An ownership-bearing Lock for a shared Resource. An Actor that successfully acquires it becomes the sole owner and may enter the protected section. Only the owner may release it; another contender becomes owner only through a later successful acquisition after release.

Preconditions

  1. A shared Resource and protected section exist.
  2. All contenders use the same mutex state.

Postconditions

  1. A successful acquisition yields exactly one owner.
  2. Non-owners do not enter the protected section.
  3. Release removes the former owner's protected access.

Invariants

  1. Exclusivity: at most one Actor owns the mutex at a time.
  2. Acquire-before-access: an Actor enters the protected section only after successful acquisition.
  3. Owner-only release: only the current owner may perform an ordinary release.
  4. Release-after-use: the owner releases the mutex after leaving the protected section.

Risks

Failure modes

  1. Deadlock

    contenders form a wait cycle and no acquisition can complete.

  2. Orphaned ownership

    an owner fails without release, leaving the mutex unavailable.

  3. Starvation

    a contender is repeatedly denied under the selected acquisition policy.

  4. Ownership violation

    a non-owner releases the mutex or enters the protected section.

Caution

Exclusive access — starvation enables denial of service.

Relationships

Builds on

Accepts

Actor

A capability-bearing entity

References

Physics

Lock

Mutual exclusion enforcement

Extends

Physics

Lock

Mutual exclusion enforcement

Nothing in this library builds on this pattern yet.

Reference

Identity

Ref
Mutex#b031
Sema ID
sema:Mutex#mh:SHA-256:b031c2dc75f23526ac765e042cd1ff77f66f0a7a23d57e480b30da0a8343e18e
Ring
0
Tier
1
Updated
2026-11-11
Supersedes
  • sema:Mutex#mh:SHA-256:0586e1f0cdc4324c2c846715464a128e9d07dd27312d56828739153ec826a8c7
  • sema:Mutex#mh:SHA-256:58bad5fd876ab54e26c1bb6882ca10aadc55681be7b443a0fb89239b184a6866
  • sema:Mutex#mh:SHA-256:8dd85c0416d43c4ab968b319b446b7c5d4ff388f01e672d2557658009540772c
  • sema:Mutex#mh:SHA-256:d9da0ec55a6d14140ae31a4e65652489310350cc52caca6a61258e42abc6b204