C++11 is the first C++ standard that deals with concurrency. The story goes on with C++17, C++20, and will continue with C++23. I'll give you a detailed insight into the current and the upcoming concurrency in C++. This insight includes the theory and a lot of practice
C++11 and C++14 have the basic building blocks for creating concurrent or parallel programs.
With C++17, we got the parallel algorithms of the Standard Template Library (STL). That means most of the algorithms of the STL can be executed sequentially, in parallel, or vectorized.
The concurrency story in C++ goes on. With C++20, we got coroutines, atomic smart pointers, semaphores, latches, and barriers.
C++23 supports the first concrete coroutine: std::generator.
With future C++ standards, we can hope for executors, extended futures, transactional memory, and more.
This book explains the details of concurrency in modern C++ and gives you nearly 200 running code examples. Therefore, you can combine theory with practice and get the most out of it.
Because this book is about concurrency, I present many pitfalls and show you how to overcome them.
The book is 100 % finished, but I will update it regularly. The next update is probably about C++26. Furthermore, I will write about lock-free concurrent data structure and patterns for parallelization.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A practical, standard-by-standard tour of concurrency in modern C++—from the C++11 memory model and threads through C++17 parallel algorithms, C++20 coroutines and synchronization primitives, to C++23 and beyond—for working C++ programmers who want theory backed by runnable examples and a clear map of the pitfalls.
【Book Arc】
- **Opening (~0%–15%)**: Orients you in the book's structure and the evolution of C++ concurrency across standards, then lays out the memory model—memory locations, the contract, atomics, and the six memory orderings—as the conceptual foundation everything else rests on.
- **Early (~15%–30%)**: Moves into hands-on multithreading: `std::thread` and C++20's `std::jthread`, mutexes and locks, thread-local data, condition variables, cooperative interruption, semaphores, latches, and barriers—the everyday toolkit for writing correct concurrent code.
- **Early–Middle (~28%–35%)**: Covers C++17 parallel STL algorithms (sequential, parallel, vectorized execution) and then C++20 coroutines—generator functions, the promise/awaiter framework, and the `co_return`/`co_yield`/`co_await` workflows—culminating in C++23's `std::generator`.
- **Middle (~35%–50%)**: Reinforces everything through extended case studies—vector summation, the dining philosophers solved many ways, thread-safe singletons, job workflows, and a thread-safe queue—then previews the future: executors, extended futures, transactional memory, task blocks, and data-parallel vectors.
- **Late (~48%–55%)**: Shifts from mechanisms to design with synchronization patterns (dealing with sharing and mutation, scoped and strategized locking, thread-safe interface, guarded suspension) and concurrent architectures (Active Object, Monitor Object).
- **Ending (~55%+)**: The excerpts do not cover the closing material in detail; the table of contents indicates patterns and best practices continue, and the author notes plans to add lock-free data structures and parallelization patterns in future updates.
【Key Takeaways】
- **The memory model is the bedrock** (Opening): Understanding memory locations, atomics, and ordering constraints (sequential consistency, acquire-release, relaxed) is what separates code that works from code that merely appears to. This is the hardest and most important part.
- **Modern C++ gives you a layered toolkit** (Early): `std::thread`/`std::jthread`, mutexes, locks, condition variables, and C++20's semaphores, latches, and barriers each solve a distinct coordination problem—knowing which to reach for is the skill.
- **C++20's `std::jthread` and stop tokens simplify cancellation** (Early): Automatic joining and cooperative interruption via `stop_source`/`stop_token`/`stop_callback` replace error-prone manual thread lifecycle management.
- **Parallel STL algorithms make data parallelism accessible** (Early–Middle): Most STL algorithms can run sequentially, in parallel, or vectorized, but performance varies by compiler and workload—measure rather than assume.
- **Coroutines are a framework, not a keyword** (Early–Middle): Promise objects, awaiters, and the suspend/resume workflows are the machinery behind `co_await`; understanding them is essential before writing your own coroutine types.
- **Case studies teach more than rules** (Middle): The dining philosophers solved a dozen ways and the vector-summation variants show how the same problem demands different synchronization strategies—and where each fails.
- **Patterns turn knowledge into architecture** (Late): Scoped/strategized locking, thread-safe interface, guarded suspension, Active Object, and Monitor Object give you reusable designs rather than ad-hoc fixes.
- **Pitfalls are first-class content** (Throughout): The book deliberately presents common errors—lost/spurious wakeups, deadlocks, busy-waiting mistakes—and shows how to overcome them, which is where real learning happens.
【Reading Tips】
- **Deep-read the memory model chapter** (roughly the first fifth). Skim it at your peril; everything later assumes you understand ordering and atomics.
- **Type along with the ~200 examples.** Concurrency bugs are invisible on the page—compile, run, and deliberately break the code to see failures.
- **Use the case studies as checkpoints.** After the multithreading and coroutine chapters, work through the dining philosophers and vector summation to test whether the primitives have clicked.
- **Skim the "Future of C++" chapter on a first pass.** Executors, transactional memory, and task blocks are forward-looking; return to them when you need to design beyond current standards.
- **Treat patterns as a reference.** Read the synchronization and architecture patterns when you face a design decision, not necessarily front-to-back.
【Coverage Limits】
This guide is based on stratified excerpts that are heavy on the table of contents and structural markers; detailed prose from the patterns, architecture, and closing chapters is not well represented, so specific claims about those sections are inferred from headings rather than full text.
Page 2
ers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many i...
t way to become an expert in the multithreading environment. This book contains both simple and advanced topics, and it has everything a developer needs, in...
dernes Cpp⁶ and the German blog⁷, hosted by Heise Developer. Since 2016, I have been an independent instructor and mentor giving seminars about modern C++ an...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Concurrency with Modern C++ What every professional C++ programmer should know about concurrency. (Rainer Grimm)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share to WeChat Moments
Concurrency with Modern C++ What every professional C++ programmer should know about concurrency. (Rainer Grimm)(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Concurrency with Modern C++ What every professional C++ programmer should know about concurrency. (Rainer Grimm)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment