System Design · Interactive workshop
The thread sharing workbench
Build it. Run it. Follow the bytes.
Threads in one process share its address space and open resources, while each thread keeps execution state such as its stack and registers. Sharing makes communication cheap, but unprotected mutable state and process-wide failure remain coupled.
The canvas runs in your browser and needs JavaScript. You can read the model below and read the accompanying Library lesson without JavaScript.
What this machine models
Model thread-machine-1 executes two independent pixel transforms, 40 to 20 and 90 to 45, on one core. Editable scratch references, process ownership, per-thread calls, saved execution state and mutex ownership drive the trace. Manual turns can branch from any earlier event.
Run deliberately overlaps the shared write/read window. An injected fatal worker fault ends its process and releases owned scratch and stacks. Each job has its own input, so the surviving job does not require a message from the failed job.
The model is not a language runtime, memory-consistency model or performance benchmark. Each worker slot has an illustrative 64 KiB stack-address reservation against a 128 KiB budget; this is not resident RAM or an OS default. Extra slots have no jobs. Temporary state clears on reload, and no assessment is saved.
By GOAT Engineer. Explore System Design · Privacy Policy · Contact.