Skip to content

Course

Go Concurrency Patterns

A production-oriented tour of goroutines, channels, cancellation, worker pools, race detection, synchronization primitives, and the patterns that keep concurrent Go systems alive.

9 lessons

Course Q&A

Reviews

Enrolled members can rate this course.

No reviews yet.

Goroutine Lifecycles and Cancellation

Own every goroutine, propagate cancellation with context, and supervise groups of concurrent work without leaks.

  1. 01Goroutine Lifetimes and OwnershipTreat goroutines as owned resources with clear startup, shutdown, and error paths rather than fire-and-forget background threads.22mOpen
  2. 02Context Cancellation in ProductionPropagate deadlines, cancellation, and request-scoped ownership through concurrent code without turning context into a junk drawer.24mOpen
  3. 03Errgroup and Supervised ConcurrencyUse errgroup and small supervisor patterns to join concurrent work, propagate first failure, and avoid orphaned goroutines.21mOpen

Channels, Pipelines, and Worker Pools

Design channel ownership, backpressure, pipelines, and worker pools that finish cleanly under failure and load.

  1. 01Channel Design and BackpressureChoose channel direction, ownership, buffering, and close responsibility deliberately so channels communicate pressure instead of hiding it.25mOpen
  2. 02Pipelines That Actually Shut DownCompose multi-stage channel pipelines with explicit cancellation and completion so downstream failure cannot strand upstream producers.26mOpen
  3. 03Worker Pools Without Leaks or Thundering HerdsBuild bounded worker pools with clean shutdown, bounded queues, result propagation, and cancellation-aware job processing.27mOpen

Synchronization, Races, and Deadlock-Proofing

Use mutexes, atomics, and the race detector correctly while recognizing the design shapes that lead to deadlock.

  1. 01Mutexes, Atomics, and sync.Once Without SuperstitionChoose the narrowest synchronization primitive that matches the invariant and learn where mutexes, atomics, Once, and condition variables actually fit.25mOpen
  2. 02Race Detection and Concurrency ObservabilityUse the race detector, execution traces, pprof, and targeted tests to expose real synchronization failures instead of hoping load reveals them.23mOpen
  3. 03Deadlock Patterns, Prevention, and PostmortemsRecognize circular waits, abandoned sends, lock-order inversion, and shutdown deadlocks before they freeze production — and debug them systematically when they do.28mOpen