Race Conditions in Details
summary
Explains that Go’s built-in detector runs with -race and can inflate memory by about 5–10x and execution time by ~20x, and still misses races (a slice example only fails on the fifth run). Recommends prevention: use atomic primitives for basic shared counters, wrap shared resources in a mutex or singleflight-backed critical section, or avoid shared memory by using channels; notes critical sections introduce starvation and liveness concerns.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 0:50Risk Condition
- 1:10Possible Results
- 1:40How to Detect
- 2:13Drawbacks
- 2:54Sample Code
- 3:12Prevent
- 3:53Critical Section
- 5:22Conclusion
related talks
22mData race detection
44m"go test -race" Under the Hood
26mGo Plays Nice With Your Computer - Race Detection and Freedom!
01h 04mDebugging data races
27mParadigms of Rust for the Go Developer
27mProduction Ready Concurrency
55mControlling Multi-Core Race Conditions on Linux/Android
15mEnemy of the State, Understanding the Many Flavors of Race Conditions
