Physics · Primitives
Lock
Mutual exclusion enforcement
Definition
Mechanism
A synchronization primitive that enforces exclusive access to a resource. At most one holder may access the protected resource at any time. The holder must explicitly release the lock to allow others to acquire it.
Preconditions
- Shared resource exists
- Contending parties can communicate
Postconditions
- Exactly one party holds exclusive access
- Other contenders are blocked or queued
Invariants
- Exclusivity: At most one holder at any time.
- Acquire-before-access: Protected resource cannot be touched without holding the lock.
- Release-after-use: Holder must release after completing the critical section.
Risks
Failure modes
Deadlock
Holder crashes or hangs without releasing, blocking all other contenders indefinitely.
Priority Inversion
High-priority contender blocked by low-priority holder.
Caution
Exclusive access — starvation enables denial of service.
Relationships
Root pattern: builds on nothing in this library.
Used by
References
Society
Cyclical connectivity modes
Infrastructure
Ownership-based mutual exclusion
Society
Atomic coordination via temporary state fusion
Society
Claim tasks and become the assigned persona
Extends
Infrastructure
Ownership-based mutual exclusion
Reference
