Go
42 notes
Some notes are currently available only in Chinese. English translations are shown when available.
- 2.8 sync.Mutexhistorical
Exclusive access to shared state with Go's Mutex, including zero-value usage, memory-ordering guarantees, critical-section design, and common mistakes.
- 2.9 sync.RWMutexhistorical
Go's reader/writer mutex: concurrent readers, exclusive writers, writer preference, non-upgradable locking, and when RWMutex is actually useful.
- 2.11 Atomic Operationshistorical
Go atomic operations, compare-and-swap, typed atomic values, atomic.Value, memory ordering, and when atomics are appropriate instead of locks.
- 2.12 Channelshistorical
Go channels as typed communication and synchronization primitives: buffered vs. unbuffered behavior, closing, ownership, blocking semantics, and runtime implementation.
- 2.13 Go Concurrencyhistorical
A map of Go concurrency: goroutines, channels, synchronization primitives, the memory model, happens-before relationships, and common concurrency patterns.
- 2.14 Goroutineshistorical
What goroutines are, how `go f(...)` starts concurrent execution, how their stacks differ from OS-thread stacks, and how the runtime schedules them.
- Goroutine Poolshistorical
Bounded concurrency, worker pools, queues, backpressure, and when a goroutine pool is unnecessary.
- 3.1 Go's G-M-P Schedulerhistorical
The Go scheduler's G, M, and P abstractions, local run queues, work stealing, blocking syscalls, GOMAXPROCS, and asynchronous preemption.
- 3.2 Escape Analysishistorical
How the Go compiler decides whether values can live in stack frames or must escape to longer-lived storage, how to inspect decisions, and why `new` does not imply heap allocation.