Files
aevolution/docs/adr/0011-thread-ownership.md
2026-10-08 12:08:53 -04:00

36 lines
1.1 KiB
Markdown

[Reviewed]
# ADR-0011: Explicit thread ownership
## Status
One simulation owner adopted; parallel scheduler deferred.
## Context
Concurrent mutation threatens replay and authority before it improves throughput.
## Decision
Application owns threads; one writer per SimulationWorld. No component thread creation. Future I/O queues bounded immutable commands admitted at ordered tick boundaries; jobs read immutable inputs and merge stably. Other executors cannot mutate simulation.
## Alternatives Considered
Locks around arbitrary components do not define order; work stealing can exist behind deterministic commits; lock-free needs evidence.
## Benefits
Simple race/ordering model.
## Costs
Initial single-core throughput and future queue design.
## Risks
Unbounded queues, blocking ticks, completion nondeterminism and teardown races.
## Consequences
Profile first. Every executor specifies owner/bounds/overload/cancel/join/failure. No detached threads or speculative lock-free code. Separate TSan job; sequential proof does not validate future concurrency.