Course Overview
What this Concurrency & Async Programming course covers, how to use it, prerequisites.
Course Overview
This course teaches you to write programs that do several things at once — correctly. It starts with the vocabulary (concurrency is not parallelism; asynchronous is not multithreaded), builds up the operating-system and hardware foundations, then works through threads, races, locks, deadlocks, atomics and memory models, queues and channels, futures and promises, async/await, event loops, coroutines, structured concurrency, cancellation and resilience, thread pools, multiprocessing, ten language runtimes, design patterns, concurrent data structures, distributed systems, GUIs, servers and embedded RTOS systems, performance and queueing theory, debugging, testing, security and current research — and ends with capstone projects and a final assessment.
By the end you will be able to:
Distinguish concurrency, parallelism, asynchronous execution, multithreading and multiprocessing.
Explain processes, threads, tasks, coroutines, event loops, schedulers and execution contexts.
Write and reason about synchronous, asynchronous, multithreaded and multiprocess programs.
Understand race conditions, data races, atomicity, visibility, ordering and critical sections.
Use locks, mutexes, semaphores, condition variables, monitors, read/write locks and atomic operations appropriately.
Understand deadlocks, livelocks, starvation, priority inversion and contention.
Use futures, promises, callbacks, async/await, generators and structured concurrency.
Coordinate concurrent work with queues, channels, message passing, actors and producer-consumer patterns.
Handle cancellation, timeouts, retries, backpressure, resource limits and error propagation.
Explain memory models, happens-before relationships, synchronization and safe publication.
Choose concurrency strategies for CPU-bound and I/O-bound workloads.
Design concurrent algorithms and reason about correctness, progress, fairness and scalability.
Debug concurrency bugs and measure performance with the right tools.
Apply these ideas to web servers, databases, GUIs, embedded systems and distributed services.
Build safe, tested concurrent applications with observability and robust shutdown.
How Every Example Was Run
Every program marked with a language below was executed while the course was being built; the text under Output is exactly what it printed.
GCC 11.2, -std=c17 -O1 -g -Wall -Wextra -pthread Ubuntu 22.04 on WSL2, x86-64, 8 hardware threads
G++ 11.2, -std=c++20 -O1 -g -Wall -Wextra -pthread CPython 3.13.1 (standard build, with the GIL) JavaScript / TypeScript Node.js 24 (V8)
Go 1.23.4 (race-detector builds cross-compiled to linux/amd64 and run in WSL2) Windows 11 / WSL2
Eclipse Temurin JDK 21 (single-file source launch) Rust, Kotlin, Swift shown for comparison — not run (no toolchain on the build machine)
Concurrency outputs are often nondeterministic. This course never presents one ordering as guaranteed unless the language and the synchronization in the program really guarantee it. When the order can vary, the course says so and, where it helps, shows several real runs side by side (labelled run 1, run 2, …). Timings are labelled as *one real run on the build machine* — your numbers will differ.
How to Use This Course
Path. Stage 1 (Beginner: foundations, threads, races, locks) → Stage 2 (Intermediate: deadlocks, atomics, memory models, queues, futures, async/await, event loops) → Stage 3 (Advanced: coroutines, structured concurrency, cancellation, pools, multiprocessing, ten language runtimes, patterns, data structures) → Stage 4 (Expert: distributed systems, GUIs/servers/embedded, performance, debugging, testing, security, research, capstones, review).
Lesson format. Each module covers: objectives, prerequisites, plain-language and precise explanations, why it matters, key terms, a diagram or timeline, syntax and APIs, complete labelled examples with line-by-line notes, output, an interleaving or state trace, correctness analysis, mistakes, failure modes and debugging, performance, security, platform caveats, real-world uses, best practices, three exercises, a quiz with explained answers, a summary and further reading.
Simulators. Fourteen interactive tools appear in the lessons that use them: concurrency timeline, race-condition lab, mutex/condition-variable simulator, deadlock graph explorer, happens-before explorer, async tracer, event-loop visualizer, producer-consumer lab, thread-pool simulator, structured-concurrency explorer, parallel speedup calculator, queueing lab, language API playground and RTOS scheduler. They are *simulations* with stated assumptions — not measurements of your machine.
Concepts without syntax. When a topic is a concurrency concept rather than a language construct, the lesson says *"This is a concurrency concept, not a language construct"* and uses pseudocode (clearly labelled), a timeline or a state diagram.
Progress. Mark a lesson complete when you have done its exercises. Opening a lesson never marks it complete.
Safety. Race and deadlock demonstrations are small programs that only harm themselves, run under detectors or with deliberate time limits. Security lessons are defensive.
Prerequisites
Comfortable programming in at least one language (functions, loops, collections, exceptions). The Memory & Program Execution course is helpful background for Modules 1, 6 and 7 but not required.