What problem does it solve?
Concurrency bugs cause lost updates, duplicate effects, deadlocks, and race-dependent invariant violations when multiple actors mutate shared resources at the same time.
Core Features & Use Cases
- Invariant-first concurrency design: names the exact invariant that must survive overlap before selecting a mechanism.
- Mechanism selection with explicit conflict behavior: chooses the narrowest control strategy (optimistic, pessimistic, atomic SQL/CAS, distributed lease with fencing, idempotency keys, queue partitioning, CRDTs, or sharded counters) and documents how conflicts are handled.
- Deadlock and TOCTOU prevention: enforces deterministic lock ordering, bounded lock/lease duration, and atomic read-check-act patterns to eliminate race windows.
- Safety for duplicates and events: specifies idempotency key storage for duplicate-submit risk and requires outbox/post-commit safety to avoid publish-before-commit.
Quick Start
Use concurrency-control to design a conflict-safe, deadlock-resistant mutation plan for a shared resource where duplicate submissions or parallel workers are possible.