Understanding the Go Runtime: The Scheduler
https://internals-for-interns.com/posts/go-runtime-scheduler/
#HackerNews #UnderstandingGoRuntime #GoScheduler #ProgrammingConcurrency #GoLang

The Scheduler | Internals for Interns
In the previous article we explored how Go’s memory allocator manages heap memory — grabbing large arenas from the OS, dividing them into spans and size classes, and using a three-level hierarchy (mcache, mcentral, mheap) to make most allocations lock-free. A key detail was that each P (processor) gets its own memory cache. But we never really explained what a P is, or how the runtime decides which goroutine runs on which thread. That’s the scheduler’s job, and that’s what we’re exploring today.