This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD status.
Section: 99 [parallel.ts::parallel.alg.general.exec] Status: NAD Submitter: Robert Geva Opened: 2015-09-22 Last modified: 2015-10-21
Priority: Not Prioritized
View all issues with NAD status.
Discussion:
Addresses: parallel.ts
Parallel algorithms as of N4352 in general
need to assume that iterator operations and swap
have the expected data race behavior.
For example, sort
would not work if the exchange operation were thread-unsafe and, for example, always updated a single
unprotected global counter, independent of the objects being swapped. A parallel sort
has to be able to assume that disjoint
pairs of objects can be swapped concurrently, i.e. that elemental functions have the same sort of thread-safety behavior that
we generally promise for the standard library versions. I don't see that assumption stated anywhere.
Function objects passed into parallel algorithms as objects of type
BinaryPredicate
,Compare
, andBinaryOperation
shall not directly or indirectly modify objects via their arguments.
But that only seems to cover the easy cases.
Proposed resolution: