Skip to content
Opensource internals
  • Posts

Signals

Go Preempts Goroutines with a Signal: Asynchronous Preemption Since Go 1.14

Oct 21, 2026 16 min read Jay Hubbert

Go preempts goroutines cooperatively by poisoning the stack bound and asynchronously with SIGURG; the signal handler checks PCDATA_UnsafePoint before injecting a call to …

GoInternalsPreemptionSignalsConcurrency

Read more →

How Go Handles Signals and Context Cancellation Without Losing Signals

Oct 21, 2026 26 min read Jay Hubbert

Signals land on a thread with a managed signal mask, get bit-packed into a lock-free queue by sigsend, and are forwarded to your channel by one goroutine; context cancellation is a …

GoInternalsSignalsContextConcurrency

Read more →

How Go's CPU Profiler Works: SIGPROF, the Signal Stack and 100 Hz Sampling

Oct 21, 2026 20 min read Jay Hubbert

A 100 Hz setitimer(ITIMER_PROF) raises SIGPROF, the handler runs on the gsignal stack, unwinds the running goroutine, and writes samples into a lock-free profBuf ring that …

GoInternalsProfilingSignalsPerformance

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·