Skip to content
Opensource internals
  • Posts

Finalizers

runtime.AddCleanup: How Go Replaced Finalizers With a Queue of Specials

Oct 21, 2026 19 min read Jay Hubbert

runtime.AddCleanup replaces SetFinalizer with span specials, a lock-free block queue and a pool of cleanup goroutines, so cleanups run promptly and in parallel instead of one at a …

GoInternalsGarbage collectionFinalizersRuntime

Read more →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·