Skip to content
Opensource internals
  • Posts

Go

entersyscall: How Go Hands the P to the Kernel and Gets It Back

Oct 21, 2026 21 min read Jay Hubbert

entersyscall marks the G as _Gsyscall but keeps its P, exitsyscall reacquires a P or parks the goroutine, and sysmon’s retake loop yanks the P away roughly 20 microseconds into a …

GoInternalsSchedulerSyscallsConcurrency

Read more →

Escape Analysis in Go: Why Your Local Variable Escaped

Oct 21, 2026 25 min read Jay Hubbert

Go’s escape analysis models variables as locations in a weighted graph, walks assignment paths looking for anything that outlives its stack frame, and stamps each variable with …

GoInternalsEscape analysisCompilerMemory

Read more →

Go Channels Are a Ring Buffer, a Lock and a Wait Queue

Oct 21, 2026 22 min read Jay Hubbert

A Go channel is a ring buffer, one mutex and two wait queues: sends and receives memmove an element, park the goroutine on a sudog, and hand off with goready.

GoInternalsConcurrencyChannels

Read more →

Go Grows Goroutine Stacks by Copying Them: The 2 KB to 1 GB Journey

Oct 21, 2026 17 min read Jay Hubbert

Go stacks start at 2 KB, double when the prologue check trips, and are copied to a new address with every pointer in every frame adjusted by the difference between the old and new …

GoInternalsStacksMemoryPerformance

Read more →

Go Passes Arguments in Registers: The Register ABI and Its Transparent Wrappers

Oct 21, 2026 18 min read Jay Hubbert

Go’s internal ABI passes arguments in registers, uses fixed registers for the goroutine pointer and a zero value, and generates ABI wrappers so old assembly keeps working.

GoInternalsAbiCompilerPerformance

Read more →

← Newer Page 1 of 12 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·