Go concurrency patterns: worker pools, fan-in, context
12 steps · about 4 h 33 min · Intermediate
- Concurrency is not parallelism (article, The Go Blog, 8 min)
Start with the mental model: concurrency is structure, parallelism is execution.
- Go Concurrency Patterns (doc, Rob Pike, go.dev/talks, 30 min)
Pike's slides introduce goroutines, channels, select and the generator and fan-in ideas.
- Go Concurrency Patterns (video, Rob Pike, Google I/O 2012, 50 min)
Watching the talk shows the patterns being built live, which makes the slides easier to follow.
- concurrency patterns (repo, GitHub, gobridge, 20 min)
Runnable code from the talk lets you try the patterns yourself.
- Go Worker Pool Pattern: Examples, Channels, and Shutdown (article, Corentin GS, 20 min)
This is a complete, runnable worker pool, with the jobs channel, WaitGroup and close ordering explained.
- Go Concurrency Patterns: Pipelines and cancellation (article, The Go Blog, 35 min)
The official source for pipelines, fan-out and fan-in, and the bounded version of the pattern.
- Concurrency patterns (article, GopherTrunk, 20 min)
A short recap and quick check that compares pipeline, worker pool and fan-out/fan-in.
- Go Concurrency Patterns: Context (article, The Go Blog, 25 min)
This explains how context carries cancellation and deadlines through every goroutine.
- 05. Worker Pools (tutorial, ByteLearn.dev, 25 min)
This adds context cancellation to a pool, using a select on both receive and send.
- Bounding Concurrency in Go: errgroup, Worker Pools, and Backpressure (article, DEV Community, 20 min)
It compares semaphores, errgroup and pools, so you can choose the simplest tool for the job.
- 14. Concurrency Cheat Sheet (reference, ByteLearn.dev, 10 min)
A decision guide and leak checklist to consolidate what you've learned.
- Go Wiki: LearnConcurrency (reference, The Go Wiki, 10 min)
A curated list of what to study next, such as the race detector, sync and the memory model.