Applied concurrency in Go
summary
A concrete progression: initial mutex-based cooks serialize work and take ~15s; naive goroutines fire everything and exit almost instantly but lose work; introducing sync.WaitGroup and per-chef goroutines plus an order wheel implemented with channels replace mutexes brings runtime down to ~7.8s and avoids premature shutdown; hardware validation uses Arduino LEDs; a remaining bug is a data race on a shared map detected with go run -race, showing channels and wait groups help but do not automatically fix shared-memory races.
AI-written summary · about
chapters (11)
- 0:00Introduction to Splice
- 1:01High-level system architecture
- 2:34The restaurant metaphor
- 3:28Initial data model and coding
- 5:32Testing synchronous approach
- 8:01Introducing goroutines
- 8:59Using wait groups
- 10:51Refactoring with channels
- 12:05Fixing channel bugs
- 13:59Addressing data races
- 15:34Lessons in concurrent code
related talks
24mMastering Concurrency in Go: From Patterns to Production
26mConcurrency primitives of Golang - how to use and how not to
27mProduction Ready Concurrency
16mIn the land of Gophers from age 3
25mTackling Contention : The Monster in sync.Locker
44mConcurrency in Go: from hardware to code ☠️
09mConcurrency for beginners
34mGo concurrency in the real world
