What it is
The Go runtime multiplexes goroutines (G) onto operating-system threads (M) through logical processors (P). Each P has a local run queue and a runnext slot, there is a global queue, and an idle P steals half of another P’s queue. A goroutine that blocks in a system call keeps its thread, so its P is handed to another thread; a goroutine that computes for too long is preempted at the end of a time slice; goroutines that wait on the network are parked without holding a thread. This simulator shows those mechanisms on a small virtual machine in whole milliseconds.
When to use it
Use it to see why goroutines spawned in a loop spread over all Ps instead of piling up on one, why blocking system calls create extra OS threads while network waits do not, why a tight loop used to starve other goroutines until preemption was added, and how GOMAXPROCS, the time slice and the retake threshold change makespan, utilisation and the wait before a new goroutine first runs. Switch stealing, handoff or preemption off to run the counter-case on the same workload, spawn goroutines yourself and rewind.
Gotchas & limits
This is a concept model, not the Go runtime. It follows the scheduler design as described in public material and recalled here (a 256-entry local queue, a runnext slot, a global queue checked on every 61st tick, stealing half of a queue, a 10 ms time slice, asynchronous preemption which arrived around Go 1.14); none of it was re-checked against a release, and the runtime changes between versions. Time is in whole milliseconds, while real scheduling works in microseconds. Garbage collection, timers, channels, locks, the real netpoller, spinning threads and cache effects are left out, and the switches for stealing, handoff and preemption are thought experiments, not runtime options. Do not use its numbers to tune a Go program.