|Reply to:||Hans-J. Boehm|
The Parallelism TS currently prohibits synchronization in functions called from vector algorithms, but says nothing about which standard library functions may invoke synchronization. Unfortunately, due to inline expansion, and the possibility of compiling nested functions in vector mode even if not inlined, this also applies to nested internal synchronization.
This is a very rough initial attempt at somewhat pinning this down. I expect this to generate PDTS comments. The reason to apply a rough fix now is to point out the issue, and hopefully generate much more relevant comments sooner rather than later.
Apply the following change to the Parallelism working paper, to 4.1.1p4:
The applications of function objects in parallel algorithms invoked with an execution policy of type
parallel_vector_execution_policyare permitted to execute in an unordered fashion in unspecified threads, and unsequenced within each thread.
[ Note: As a consequence, function objects governed by the parallel_vector_execution_policy policy must not synchronize with each other. Specifically, they must not acquire locks. -- end note ]