Open lewissbaker opened 3 months ago
This issue needs a paper to be written, ideally in time for the October 2024 mailing (pre-Poland).
The specification of this may have some dependencies on changes to async-scope design currently being considered by @ispeters, but the motivation/design parts of the paper should be largely independent of that.
The current (P2300R10) cancellation semantics of the
split
algorithm are that if any of the consumers sends a stop-request then the underlying operation is cancelled for all consumers (see #200).We should revise the semantics so that it instead only cancels the underlying operation when the last consumer goes away. However, to do this in a way that avoids the possibility of detached work, it needs to be an algorithm over an async-scope.
We should replace the current semantic of
split()
with something with the following shape:And with the following semantics:
split()
allocates shared state for holding the child operation state and the result of the operation.get_allocator(env)
split()
nests the input sender in the async-scope usingscope.nest(source)
and eagerly connects the result to an internal receiver, storing the operation-state in the allocated shared state.get_env()
returnsenv
.There are similar questions with this algorithm, though, about whether the allocation of the shared state should be guarded by the async-scope. i.e. so that
join()
completes only after all allocations made bysplit()
, et. al. are released.