๐Ÿงต Reference compendium

C++ concurrency and parallelism, for low-latency services.

A reference on writing correct, fast concurrent and parallel C++ for Linux services that care about tail latency and throughput โ€” from the futex underneath a mutex to lock-free messaging on the fast path, in C++20, C++23, and C++26. Read it straight through, or jump to the part that answers the question you have right now.

C++20 / C++23 / C++26 Linux clang / gdb Docker Low latency High throughput

The parts

Nine parts, read in order the first time. Each part page lists its chapters; each chapter stands on its own for a reader jumping in to solve one problem. The orientation part is the map โ€” start there if you only have time for one page.

Part 0

Orientation

How to read this book, who it's for, the KVM lab used for parallelism work, and the C++20/23/26 standards tabs that run through every chapter.

1 chapterExplore โ†’
Part 1

Foundations

Concurrency versus parallelism, the machine underneath โ€” cores, SMT, cache, NUMA โ€” time and deadlines, and threads in modern C++.

4 chaptersExplore โ†’
Part 2

Shared State and Synchronization

The futex underneath a lock, mutual exclusion, coordination primitives, the memory model, and lock-free structures.

5 chaptersExplore โ†’
Part 3

Tasks, Futures, and Asynchrony

Futures and packaged tasks, coroutines, async runtimes and event loops, and stackful fibers.

4 chaptersExplore โ†’
Part 4

Parallelism and Throughput

Parallel algorithms and execution policies, thread pools, NUMA and affinity, and SIMD data parallelism.

4 chaptersExplore โ†’
Part 5

Low Latency and High Throughput

Benchmarking without deception, the fast path, mechanical sympathy, and lock-free messaging.

4 chaptersExplore โ†’
Part 6

Communications and Concurrency

Communication models, the actor model and channels, concurrent REST, and concurrent gRPC.

4 chaptersExplore โ†’
Part 7

Correctness, Errors, and Debugging

Error versus exception handling, debugging real races and deadlocks, sanitizers, and observing concurrency in production.

4 chaptersExplore โ†’
Part 8

Practice: Design, Containers, and a Full Example

Coding practices, design and architecture patterns, concurrency in containers, and an end-to-end project that ties the book together.

4 chaptersExplore โ†’
Part 9

Appendix

Build and toolchain reference: clang, gdb, CMake presets, and Conan lockfiles, plus the Lua verify.lua harness used to confirm every example actually does what it claims.

1 chapterExplore โ†’