Go concurrency patterns: worker pools, fan-in, context

12 steps · about 4 h 33 min · Intermediate

  1. Concurrency is not parallelism (article, The Go Blog, 8 min)

    Start with the mental model: concurrency is structure, parallelism is execution.

  2. 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.

  3. 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.

  4. concurrency patterns (repo, GitHub, gobridge, 20 min)

    Runnable code from the talk lets you try the patterns yourself.

  5. 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.

  6. 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.

  7. Concurrency patterns (article, GopherTrunk, 20 min)

    A short recap and quick check that compares pipeline, worker pool and fan-out/fan-in.

  8. Go Concurrency Patterns: Context (article, The Go Blog, 25 min)

    This explains how context carries cancellation and deadlines through every goroutine.

  9. 05. Worker Pools (tutorial, ByteLearn.dev, 25 min)

    This adds context cancellation to a pool, using a select on both receive and send.

  10. 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.

  11. 14. Concurrency Cheat Sheet (reference, ByteLearn.dev, 10 min)

    A decision guide and leak checklist to consolidate what you've learned.

  12. 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.