Files
atelier/domains/concurrency/first-principles.md
T
Jon Chery 496303471d docs(milestone): complete v0.1 — initial framework
---ci---
project: atelier
phase: 7
milestone: v0.1
status: complete
phase_role: final
milestone_complete: true
requirements:
  covered: [ATELIER-01, ATELIER-02, ATELIER-03, ATELIER-04, ATELIER-05, ATELIER-06, ATELIER-07, ATELIER-08, ATELIER-09, ATELIER-10, ATELIER-11, ATELIER-12, ATELIER-13, ATELIER-14, ATELIER-15, ATELIER-16, ATELIER-17, ATELIER-18, ATELIER-19, ATELIER-20, ATELIER-21, ATELIER-22, ATELIER-23, ATELIER-24, ATELIER-25, ATELIER-26, ATELIER-27, ATELIER-28, ATELIER-29, ATELIER-30, ATELIER-31, ATELIER-32, ATELIER-33, ATELIER-34, ATELIER-35]
  partial: []
ship:
  milestone: v0.1
  type: NFR
  tag: v0.0.7
  merge: milestone/v0.1-atelier -> main
  release: https://git.cloudinit.dev/cloudinit-bot/atelier/releases/tag/v0.0.7
---/ci---

Milestone v0.1 — Initial Framework (NFR, complete).
8 core principles (C1-C8), 11 domains, 110 domain principles, 27 derived docs, 4 good + 3 bad examples, 4 language docs, full matrix, 3 review docs.
All 35 requirements covered. 7 patches (v0.0.0 pre-execution through v0.0.7 final). v0.0.7 IS the v0.1.0 milestone release.
2026-08-05 00:36:55 +00:00

41 lines
1.2 KiB
Markdown

# Concurrency — First Principles
## 1. The Principles
### P1. Immutability by Default
Mutable shared state is the enemy. The default is immutable; mutation
is justified.
### P2. Single Responsibility for Threads
Each unit of work has one owner. No "anyone can touch this" state.
### P3. Boundaries are Locks
Synchronization happens at well-defined places. Lock scope is
minimal and explicit.
### P4. Determinism Over Speed
Correct concurrent code is faster than incorrect concurrent code.
Race conditions are not "fast enough" — they are wrong.
### P5. Lock Minimization
Locks are expensive and dangerous. Lock-free, wait-free, and
message-passing are preferred where possible.
### P6. No Silent Races
Race conditions are caught, not hidden. Tools (TSan, Go race
detector) are part of CI.
### P7. Cancellation Support
Every async operation can be cancelled. Cancellation is fast and
complete.
### P8. Timeout Discipline
Every blocking call has a timeout. Forever is not a duration.
### P9. Bounded Queues
Unbounded queues are memory leaks in disguise. Bounded queues
expose backpressure.
### P10. Test for Race Conditions
Concurrent code is tested under concurrent load, not just happy-path
correctness.