The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Madhusudhan Srikkanth (7) [Avatar] Offline
Hi Anthony,

In Listing 4.27, you say that you will rewrite Listing 4.26 which uses std::experimental::barrier to instead use std:: experimental::flex_barrier. In doing this you have ended up changing the behavior of the program.

Listing 4.26 will work if source had just enough data in it to split it once i.e it would still work if source.done() returned true after splitting the data block in it once.

But Listing 4.27 won't work in this case with the threads falling out of the while loop immediately which is a flaw.