📄️ Go Memory Model
Understand how Go defines the ordering of memory operations across goroutines and what guarantees you actually get.
📄️ Happens-Before: Mutex, Channels, Atomic, WaitGroup
A precise look at which Go synchronization primitives establish happens-before relationships and how to reason about them.
📄️ Data Races: Why 'It Works on My Machine' Is a Lie
What data races really are, why they produce undefined behavior even when tests pass, and how to find and fix them.
📄️ Goroutine Scheduling: The G, M, P Model
How Go's runtime scheduler works under the hood — goroutines, OS threads, and processors — and what this means for your programs.
📄️ Preemption: Why Tight CPU Loops Can Starve Other Goroutines
Go's goroutine preemption model and the surprising ways a CPU-bound goroutine can hold up the entire program.
📄️ Channel Internals: Buffered vs Unbuffered
How Go channels work under the hood — the hchan struct, goroutine queues, and the exact mechanics of blocking.
📄️ select: Fairness and Pseudo-Random Case Picking
How Go's select statement chooses between multiple channel operations, its fairness properties, and practical patterns.
📄️ Closing Channels: Who Closes and What Receivers Observe
The rules around closing Go channels, what receivers see after close, and the conventions that prevent panics.
📄️ Nil Channels: The Disabled Case Pattern
Why sending to or receiving from a nil channel blocks forever, and how to use this property to elegantly disable select cases.
📄️ Context Cancellation: Deadlines, Propagation, and Cleanup
How context.Context works, how cancellation propagates through goroutine trees, and the patterns for proper cleanup.
📄️ sync.Once: Internals and Deadlock Patterns
How sync.Once guarantees exactly-once execution, its internal implementation, and the surprising deadlock you can hit.
📄️ sync.Pool: What It Is, What It's Not, and GC Interaction
sync.Pool provides a cache of temporary objects to reduce allocations — but it's not a long-lived cache, and the GC can drain it at any time.
📄️ GOMAXPROCS: What It Really Controls
GOMAXPROCS sets the number of OS threads that can execute Go code simultaneously — not the total number of threads, and not the number of goroutines.
📄️ atomic.Value vs Mutex vs Channels: When to Use Which
A practical decision guide for choosing between Go's three main synchronization primitives based on your access patterns and performance needs.
📄️ Map Concurrency: Why Concurrent Writes Crash Go
Go maps are not safe for concurrent use. Learn why concurrent writes cause a fatal panic, and the right tools for concurrent map access.
📄️ Race Detector: What It Catches and What It Cannot Prove
Go's -race flag instruments your program to detect data races at runtime. Here's how it works, what it reliably catches, and its limitations.