Search⌘ K

Execution Policies

Explore execution policies in C++17 that specify how parallel STL algorithms operate, from sequential to parallel and vectorized execution. Understand the differences and applications of sequenced_policy, parallel_policy, and parallel_unsequenced_policy to optimize multithreaded computations.

Execution Policy Parameter

The execution policy parameter will tell the algorithm how it should be executed. We have the following options:

Policy Name Description
sequenced_policy It is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and requires that a parallel algorithm’s execution not be parallelised.
parallel_policy It is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel algorithm’s execution may be parallelised.
parallel_unsequenced_policy It is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel
...