Production Ready Concurrency
summary
Practical rules and concrete tools: run tests with -race detector, avoid globals, always wait for goroutines and propagate cancellations via context; common bugs include background goroutines hitting a closed DB, WaitGroup Add/Done races, deadlocks from skipped items, mutexes blocking cancelled requests, and leaked channels. Prefer errgroup, sync.Once or small, well-tested custom primitives over ad hoc worker pools. Examples shown: a context-aware sleep, a test wrapper that prevents goroutine leaks, a channel-based semaphore limiter, and a background task manager wired to a root context.
AI-written summary · about
chapters (4)
- 0:00Concurrency best practices
- 10:48Debugging common mistakes
- 17:09Choosing concurrency tools
- 19:35Building custom primitives
related talks
24mMastering Concurrency in Go: From Patterns to Production
26mConcurrency primitives of Golang - how to use and how not to
18mApplied concurrency in Go
32mConcurrency Patterns in Go
41mDetecting and Fixing Unbound Concurrency Problems
47mDeadlocks: The Dark Side of Concurrency
40mDebugging concurrency programs in Go
01h 01mRoundtable: Concurrency
