Yesterday I finally updated the book! The main point of this refresh was to provide an updated and rewritten version of the “Parallel Algorithms” chapter. “C++17 In Detail” grew by 20 pages (up to 270).

See what’s inside.

The Changes  

The release notes are straightforward this time :)

  • Parallel Algorithms chapter updated
  • Some smaller fixes (for example I updated the link to code samples: Source Code(ZIP)

Here’s the link to the book:

C++17 In Detail @Leanpub

The Parallel Algorithms Chapter  

The initial version of the chapter comes from the post:

C++17 in details: Parallel Algorithms

Plus, along the way, I wrote two more posts:

All in all, over the time I gathered a bit of experience with parallel algorithms. Not to mention is the fact that in Mid 2018 I could finally use the algorithms in Visual Studio. Other popular compilers: GCC and Clang are still in the process of bringing that component to their STL implementations.

The new chapter includes description of all execution policies:

  • std::execution::seq
  • std::execution::par
  • std::execution::par_unseq

And also I described new algorithms that were added to the library:

  • for_each, for_each_n
  • reduce, transform_reduce - very powerful algorithms that are “power horse” of many parallel implementations and techniques
  • scan, exclusive_scan, inclusive_scan and a fused version with the transform step.

And the examples:

  • lots of benchmarks
  • how to iterate over many containers
  • count if implementation
  • smaller examples for algorithms

The examples and techniques will also be used in a more extensive application that I plan to include in the “Third Section” of the book - where there are bigger apps/problems described.

Special thanks to Billy O’Neil, for explaining some of the details of MSVC implementation! His last post Using C++17 Parallel Algorithms for Better Performance | Visual C++ Team Blog was especially valuable to me when writing the text.

And special thanks to JFT, Jacek Galowicz, Łukasz Rachwalski and other reviewers who contributed to the chapter!

Book Mentions  

So far the book was mentioned in several places.

The Plans  

The book is still now 100% ready, and here’s the general overview of what you can expect in the following months:

  • rewrite the filesystem chapter
  • add more examples to the third part of the book

I hope to finish the book with two major updates: at the end of November and then at the end of December.

Some minor fixes might happen along the way.

Until the book is not 100% done, you have a chance to buy it much cheaper and get free updates later.

Your Feedback  

I appreciate your initial feedback and support! The book has now more than 525 readers! That’s not too bad I think :)

Let me know what’s your experience with the book. What would you like to change? What would you like to see more?