No doubt.
I learned a lot from this chapter and yet I had absolutely no hope that I could actually write something real-world using the Concurrency API without considerable more work.
It’s not always this way. The first time I read about C++ lambdas in a Meyers book, I knew exactly what I would do with them when I got my hands on them.
Most of it just seemed so obvious, and even the non-obvious parts like “each lambda is a unique type” actually make a huge amount of sense once you’ve thought it through — really the only possible correct decision.
But not Concurrency! It’s not Meyers’ fault. The Concurrency API has a great deal of moving parts, their interactions are decidedly non-obvious, and more, people don’t naturally think concurrently.
For example, I think most people who were already enjoying C++ could use lambdas more or less right the first time, every time. But it took me years from the first time I encountered multithreaded locking to the point I was fairly confident I was not doing stupid things, and that involved doing stupid things and getting burnt. Reading a lot of other people’s code convinces me that this difficulty in writing correct concurrent code is a near-universal issue.
Thanks for a strong review of a Great book about C++!