Main fiber shutdown joins spawned children
Platform spec ADR
Main fiber shutdown joins spawned children
Spec standingStandard
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Context
Section titled “Context”Process exit must not leak running fibers that share the GC heap. Fire-and-forget tasks still need defined failure behavior.
Decision
Section titled “Decision”| Rule | Detail |
|---|---|
| Main fiber | main() runs on fiber 0; scheduler starts before entry |
| Normal exit | When main returns, runtime Joins every spawned fiber that was not Detached |
| Detach | Detach fibers are not joined at shutdown |
| Detach panic | Unjoined Detach child panic still aborts the process |
| Pool shutdown | After joins complete, worker thread pool stops |
Matches D-CORE-CONC-0004.
Consequences
Section titled “Consequences”Hosts and tests must account for shutdown latency from outstanding joins.
Verification anchors
Section titled “Verification anchors”Runtime main harness; corelib concurrency shutdown tests.