Summary
Is there a simple way to do parallelism and concurrency in C++? It’s easier than it used to be, in that we rarely need to create our own threads and deal with their synchronization unless we’re building infrastructure code. We don’t necessarily need external libraries or tools since STL supports parallel execution for many algorithms.
However, we can’t avoid the essential complexity of parallel and concurrent programming. Programs that take advantage of it need to be structured differently, have additional constraints, and require a different mindset and a different design paradigm. This isn’t a C++ problem – it’s a problem for any attempt at parallelism.
Therefore, the conclusion is that it can be simpler than it used to be if we make the right choices, but it’s still very complicated.
In the next chapter, we’ll ask the question of whether the fastest form of C++ is inline assembly.