Book Review: "C++ Concurrency in Action" by Anthony Williams
Here's a review of Anthony Williams' book "C++ Concurrency in Action" which probes C++ 11 threading and concurrency, including general parrellisms, data scructures, and more!
Join the DZone community and get the full member experience.Join For Free
Anthony Williams is a member of the C++ standards committee, and the author of Just Threads, one of the earliest implementations of a standards-conforming C++11 threading library. This book is an overview of concurrent and parallel programming with the new C++11 threading features. It's both a tutorial and a reference, with a large chunk dedicated to a detailed encyclopedic listing of all the C++11 threading-related objects and their methods (I'm not sure how useful this is in 2016 when all these references are already online, but could certainly be more relevant in early 2012 when the book was initially published).
The book is very comprehensive. It not only goes over the C++11 threading and concurrency features (of which there's a very good and thorough coverage), but also discusses general parallelism topics like concurrent data structures, including lock-free variants, thread pools and work-stealing. As such, it's not light reading and is definitely a book you go back to after finishing it tore-read some of the more complex topics.
On the critical side, the book's age already shows. I imagine the author didn't have access to fully conformant compilers when he was initially writing it, so many C++11 features are not used when they should be: things like range loops, reasonable uses of auto, even placing the ending >> of nested templates together without whitespace in between. Instead, there are occasional uses ofBoost. All of this is forgivable given the book's publish date, but a bit unfortunate in a book specifically dealing with the C++11 standard.
Other random bits of criticism:
- The analogies the author uses are weird, and often unhelpful. The book is clearly aimed at seasoned programmers, so we should drop the dumbing down.
- Diagrams are sometimes ugly and sometimes nice.
- The explanation of memory ordering semantics wasn't amazing, IMHO. I realize it's a devilishly complex topic to explain, but feel it's important to mention in case someone wants to get this book solely to understand memory ordering.
- The code samples living in a .zip file that you can download are sometimes slightly different from the listings in the book, and I found several occasions where they don't compile. Unfortunately, emails sent to the author about these were not answered.
Overall, I liked the book. It's not perfect, but it's the best we've currently got to cover advanced concurrency and parallelism with modern C++. This book is hard to fully digest in a single reading because you're not likely to really need everything it covers. I expect it to be useful in the future as I need to refresh some specific topics.
Published at DZone with permission of Eli Bendersky. See the original article here.
Opinions expressed by DZone contributors are their own.