This bestseller has been updated and revised to cover all the latest changes to C++ 14 and 17! C++ Concurrency in Action, Second Edition teaches you everything you need to write robust and elegant multithreaded applications in C++17.
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
About the Technology
You choose C++ when your applications need to run fast. Well-designed concurrency makes them go even faster. C++ 17 delivers strong support for the multithreaded, multiprocessor programming required for fast graphic processing, machine learning, and other performance-sensitive tasks. This exceptional book unpacks the features, patterns, and best practices of production-grade C++ concurrency.
About the Book
C++ Concurrency in Action, Second Edition is the definitive guide to writing elegant multithreaded applications in C++. Updated for C++ 17, it carefully addresses every aspect of concurrent development, from starting new threads to designing fully functional multithreaded algorithms and data structures. Concurrency master Anthony Williams presents examples and practical tasks in every chapter, including insights that will delight even the most experienced developer.
What's inside
Full coverage of new C++ 17 features Starting and managing threads Synchronizing concurrent operations Designing concurrent code Debugging multithreaded applications
About the Reader
Written for intermediate C and C++ developers. No prior experience with concurrency required.
About the Author
Anthony Williams has been an active member of the BSI C++ Panel since 2001 and is the developer of the Pro extensions to the C++ 11 thread library.
Table of Contents
Hello, world of concurrency in C++! Managing threads Sharing data between threads Synchronizing concurrent operations The C++ memory model and operations on atomic types Designing lock-based concurrent data structures Designing lock-free concurrent data structures Designing concurrent code Advanced thread management Parallel algorithms Testing and debugging multithreaded applications
Disclaimer: I only read up to (and including) chapter 7, even though I learned the contents of the book through my university module that included the material, except chapter 10 and 11. The HUGE appendix, I just dipped into a bit, without studying/making use of it to thoroughly.
That said, I really liked the book! The structure is clear and set out in a way, that doesn't get to dense with complicated to understand things. The text is written in a prose that gives motivation for why things the way they are, context for what you have to look out to and insight to newer developments/experimental features. It's a nice read, the examples are well chosen as well. Can't really complain, except maybe that even more diagrams here and there would be nice (e.g. with the "ABA" problem).
My only concern and caveat that I would warn you off: Like you know already, technology (especially in computer science) advances at a unprecedented and increasing pace - this book is no exception. It only covers features up to C++17, so newer features like std::jthreads, std::stop_tokens, as well as semaphores, latches and others are NOT included in the book. With C++23 just having dropped and C++26 being in its first stage of concepts, you miss out on (at this point in time) two versions that among other things expanded the multi-threading standard libraries. A newer version for the book is not planned/announced to my knowledge, but hopefully one will come out eventually.
The code examples were quite difficult to get through and the explanations were in general just simple rewordings of the annotated code line. Given the complexities of some of the later chapters, more explanation felt necessary since it would take several rereadings to even vaguely get the subtle considerations in the example.