Skip to content

Concurrent Thinking and Fundamentals ​

In our view, concurrency is a watershed in C++ engineering ability. Once the growth in single-core frequency ran into the power wall, nearly all further gains in modern software performance came to depend on two directions: better algorithms, and better parallelization. And the foundation of parallelization is concurrency — letting multiple flows of execution work in concert, without breaking correctness, to squeeze the full compute out of multi-core hardware. Frankly, if the program you write always runs single-threaded and sequential, then no matter how beautiful the code is, you are wasting most of the transistors on that CPU of yours.

Before we write any multithreaded code, though, we must first answer three questions: why do we need concurrency? What exactly goes wrong when concurrency enters the picture? And how do the CPU and the operating system support multiple threads? Most tutorials would open by teaching you std::thread right away; we would rather not. We want to build the mindset of the concurrency field first — correctness before performance. That is the principle for this entire volume.

In This Chapter ​

pdf-latest-4-g85128cc · 85128cc · 2026-10-05