pika
pika copied to clipboard
Ensure `thread_pool_scheduler` annotations work with stdexec
We currently disable the schedule_from
customization for thread_pool_scheduler
with stdexec: https://github.com/pika-org/pika/blob/cb8ebe0667c903cd3155201b2a356f0e15b19855/libs/pika/executors/include/pika/executors/thread_pool_scheduler.hpp#L269-L287. We should make sure the customization is used even with stdexec enabled.
In the case of this example, transfer
should inherit of the scoped_annotation
if no annotation is set on the scheduler
(pseudo code):
scoped_annotation annotation("annotation");
auto s = schedule(sched) | then() | transfer(sched) | then();
It may be possible to dispatch to the default implementation using the new transform_sender
mechanism in stdexec (https://ericniebler.github.io/wg21/D2999R1.html). The process would look like this:
- customize
schedule_from
forthread_pool_scheduler
/thread_pool_domain
viatransform_sender
- update the scheduler to have the appropriate annotation
- dispatch to the default implementation with
transform_sender
anddefault_domain
- use the customization of
schedule
inside the default implementation ofschedule_from
The transition in stdexec is not fully complete, so we may have to wait a bit before trying it out.