Go Plays Nice With Your Computer - Race Detection and Freedom!
summary
Go guarantees data-race-free sequential consistency but races still happen, so the race detector instruments every memory access and uses vector clocks to detect unordered conflicting writes. Upgrading TSAN v2 to TSAN v3 removes the ~8,000 goroutine limit (tests spin up 10,000 goroutines), cuts race-check overhead about sixfold in a microbenchmark, and replaces a 60%-time spinlock with a lock-free compare-exchange path (runtime CPU share drops from ~98% to ~53%). Race detector still runs at runtime and can miss multiword-structure races.
AI-written summary · about
chapters (12)
- 0:00Go and memory models
- 2:10Weak vs strong hardware models
- 4:43Go memory model guarantees
- 7:13Why data races break reasoning
- 8:18Happens-before in concurrency
- 10:46Vector clocks analogy
- 13:39Vector clocks detect events
- 16:31Go 1.19 race detector
- 17:36Demo goroutine limit test
- 19:45Benchmarking overhead
- 21:12TSAN v2 vs v3 profiling
- 24:25Race detection limits








