Partners: KDAB Whole Tomato Software CppDepend

05 November 2018

Parallel Algorithms Chapter in C++17 In Detail

C++17 In Detail

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?

48h Promo - 15% less! (Expired)

To celebrate the third update, I’m lowering the minimal price from 14,99$ to 12,99$ (~15% less!) for the next 48h. The promo ends on Wednesday 7th Nov, 8am CET

Get my free ebook about C++17!

More than 50 pages about the new Language Standard.

C++17 in detail, by Bartlomiej Filipek

© 2017, Bartlomiej Filipek, Blogger platform
Any opinions expressed herein are in no way representative of those of my employers.
This site contains ads or referral links, which provide me with a commission. Thank you for your understanding.