Description
There is currently no way for a caller that invokes the bulk()
algorithm to indicate to that algorithm that a given strategy for invoking f
is either allowed or not allowed to invoke f
concurrently.
Ideally, the caller of bulk()
would be able to pass an execution policy (e.g. seq
, par
, unseq
, par_unseq
) to indicate in which ways it is safe to execute f
.
e.g. stdex::bulk(pred, stdex::par, n, f)
to indicate that f
is safe to call concurrently on multiple threads from an execution context that provides parallel forward progress, but not safe to call concurrently from execution agents with weak forward progress guarantees.
e.g. stdex::bulk(pred, stdex::seq, n, f)
to indicate that f
is only safe to call sequentially, even if you're on an execution context that can potentially execute across multiple threads.