AiTeky Original Interactive Learning & Practice Intermediate
Go: shared counters, worker pools and cancellation
See how two goroutines updating one counter can lose updates and how a lock or a channel fixes it, how a pool of workers turns a queue of jobs into throughput, and how forgotten cancellation leaves goroutines piling up.
Go is a language built for networked services that do many things at once. Its goroutines are very cheap lightweight tasks, and its channels let them pass messages to each other. That makes concurrency easy to start, and easy to get wrong in three classic ways: races on shared data, workers and queues sized badly, and goroutines that never stop.
This course models those ideas with small Python programs you can run in your browser. Python stands in for Go: the code is not Go, and it is deterministic (we choose the order in which steps interleave, so the results are repeatable), but the behaviour it shows is real. Check the Go documentation for exact syntax and the race detector. All numbers are made up.
- Learn lessons explain one idea at a time and let you run it.
- Industry ready lessons decide and justify, and end with interview questions.
No Go experience is assumed. Basic Python helps.
- ▶ Run code in your browser. Nothing to install
- ✓ Exercises that check themselves
- 📖 Tap a word to see what it means
Locked. Sign up free
Learn
Understand each idea with everyday examples. No coding background needed.
- 00 25 min 🔒 AiTeky Pass Start here: doing several things at once Picture a kitchen with several cooks, see why they must not write on the same notepad at the same moment, and learn what a goroutine and a channel are for.
- 01 30 min Free sample 🔒 AiTeky Pass Two workers, one counter Model two tasks that each add one to a shared counter by reading it, adding, and writing back, list every way their steps can interleave, see which orders lose an update, and fix it by making the read-add-write a single protected step.
- 02 30 min 🔒 AiTeky Pass A pool of workers and a queue Simulate a queue of jobs served by a fixed number of workers, find how completion time and idle time change with the number of workers, see where extra workers stop helping, and see what a forgotten channel close does to workers that wait forever.
Industry ready
Real problems from real jobs, and the questions interviewers ask about them.

