January 2018
Intermediate to advanced
374 pages
9h 53m
English
The parallel unsequenced policy, std::execution::par_unseq , executes the algorithm in parallel like the parallel policy, but with the addition that it may also vectorize the loop using, for example, SIMD instructions if plausible.
In addition to the vectorization, it has stricter conditions for the predicates than std::execution::par:
The following example might cause a deadlock as the std::execution::par_unseq might execute concurrently on the same thread:
auto trees = std::vector<std::string>{"Pine", "Birch", "Oak"};auto m = std::mutex{};