Description
In P2300R10, the default implementation of bulk
is specified to just call f
N times in a loop.
However, this loop does not attempt to inspect any stop-token to watch for a stop-request.
This means that once it starts executing there is no way to get it to stop.
If this is a loop of N=1'000'000 iterations that will run for 30s+ then there could be quite a large latency waiting for the operation to complete in the case that the result is no longer required and a stop-request has been issued.
Should we be requiring that the default bulk
operation periodically checks for a stop-request if the receiver connected to the bulk operation has a stop-token with stop_possible()
equal to true
?
Customizations need not be required to check for a stop-request, but we should at least consider specifying the default implementation to check for a stop-request and early-exit the for-loop.