PidokuInfra
04Concurrency

Concurrency

IntermediateModule 046 topics~5h 40m

Topics, in order

About this module

Goroutines are why most people choose Go. This module explains what one actually is, how the runtime runs millions of them on a handful of threads, and how to write concurrent code that is correct — not merely code that happens to pass its tests.

#LessonThe question it answers
01Goroutines and the SchedulerWhat is a goroutine, and who decides when it runs?
02ChannelsWhat is a channel made of, and what do send, receive and close really do?
03Select, Context and CancellationHow do I wait on several things and stop work that is no longer wanted?
04Sync and AtomicsWhen do I use a mutex, an atomic or a channel?
05The Memory Model and Data RacesWhat exactly is a data race, and what does Go guarantee?
06Concurrency PatternsHow are worker pools, pipelines and bounded concurrency built — without leaks?

When you finish you can draw the scheduler, predict what any channel operation does, write a cancellable worker pool, and explain why a program with a data race has no defined behaviour.

↑↓ navigate↵ openesc close