Introduction to Parallelism

Modern processors are built for parallel execution, not sequential code. This course shows how to use multithreading and vectorization in C++ to match that reality.

4.8 (6,947 reviews)
1
Asynchronous Tasks with std::async
Offload heavy work to other CPU cores. Learn how std::async and std::future enable concurrent execution.
2
Parallel Algorithms and Execution Policies
Combine the elegance of C++20 Ranges with the power of parallel execution policies.
3
Locks and Atomics
Learn how mutexes and atomics prevent race conditions, and why hardware contention can make multithreaded code slower than single-threaded code.
4
Cache Coherency and False Sharing
Explore the performance cost of synchronization, how to mitigate it, and how to avoid it entirely with better algorithm design.
5
The std::atomic API and Data Tearing
Understand the physical reality of moving data between RAM and registers. Learn why explicit loads and stores are required to prevent data tearing in complex structs.
6
Compare-And-Swap and Optimistic Concurrency
Learn how to perform complex lock-free atomic updates using compare_exchange_weak() and the hardware limitations.
7
Memory Orders and Instruction Reordering
Demystify C++ memory ordering. Learn how CPU out-of-order execution breaks lock-free code, and how to use seq_cst, acquire, release, acq_rel, and relaxed to fix it.
8
SIMD and Automatic Vectorization
Learn how SIMD registers allow you to process multiple data points in a single instruction, unlocking the full power of each CPU core.