Go's GMP: The 3-Step Goroutine Stealing Order

In Go's GMP model, when a Processor (P) runs out of tasks, it first checks its local run queue, then the global run queue (periodically, e.g., 1/61 of the time to ensure fairness), and if both are empty, it attempts to steal half of the goroutines from another random P's local queue. [5, 6, 12, 14, 16]

Sources

Open the full topic