Modern C++ Concurrency: Get the most out of any machine
Explore modern C++ concurrency, from C++11 to C++20, combining theory with practice. Gain insights into parallel algorithms, co-routines, and best practices through interactive examples and real-world scenarios.
- Apply the C++11/14 memory model to reason about atomic operations and multithreaded behavior
- Implement threads with std::thread and manage lifetime via join, detach, and scoped_thread
- Use mutexes, lock types, and condition variables to synchronize shared data and avoid deadlocks
- Build task-based concurrency using std::async, packaged_task, promises, futures, and shared_future
- Analyze and choose atomic memory orders (seq_cst, acquire-release, relaxed) and fence usage
- Verify concurrent code behaviors and data races using CppMem execution graphs and outcomes
- Use C++17 parallel STL algorithms with execution policies for sequential, parallel, or vectorized runs
Learning Roadmap
2.
A Quick Overview
A Quick Overview
3.
Memory Model: The Contract
Memory Model: The Contract
2 Lessons
2 Lessons
4.
Memory Model: Atomics
Memory Model: Atomics
9 Lessons
9 Lessons
5.
Memory Model: Synchronization and Ordering Constraints
Memory Model: Synchronization and Ordering Constraints
9 Lessons
9 Lessons
6.
Memory Model: Fences
Memory Model: Fences
5 Lessons
5 Lessons
7.
Multithreading: Threads
Multithreading: Threads
9 Lessons
9 Lessons
8.
Multithreading: Shared Data
Multithreading: Shared Data
12 Lessons
12 Lessons
10.
Multithreading: Condition Variables
Multithreading: Condition Variables
2 Lessons
2 Lessons
11.
Multithreading: Tasks
Multithreading: Tasks
11 Lessons
11 Lessons
12.
Case Study: Calculate Sum of a Vector
Case Study: Calculate Sum of a Vector
15 Lessons
15 Lessons
13.
Case Study: Thread-Safe Initialization of a Singleton
Case Study: Thread-Safe Initialization of a Singleton
9 Lessons
9 Lessons
14.
Case Study: Ongoing Optimization with CppMem
Case Study: Ongoing Optimization with CppMem
9 Lessons
9 Lessons
15.
Parallel Algorithms of the Standard Template Library
Parallel Algorithms of the Standard Template Library
5 Lessons
5 Lessons
16.
The Future: C++20
The Future: C++20
11 Lessons
11 Lessons
17.
Coding Examples
Coding Examples
9 Lessons
9 Lessons
18.
Best Practices
Best Practices
5 Lessons
5 Lessons
19.
The Time Library
The Time Library
7 Lessons
7 Lessons
20.
Glossary
Glossary
2 Lessons
2 Lessons
Rainer Grimm
I’ve worked as a software architect, team lead, and instructor since 1999. I like to write articles on the topics C++, Python, and Haskell in my spare time. I often speak at conferences.
Trusted by 2.9 million developers working at companies
Anthony Walker
@_webarchitect_
Evan Dunbar
ML Engineer
Software Developer
Carlos Matias La Borde
Souvik Kundu
Front-end Developer
Vinay Krishnaiah
Software Developer
Built for 10x Developers












Free Resources