hpx/executors/thread_pool_continues_on_sender.hpp

hpx/executors/thread_pool_continues_on_sender.hpp#

Defined in header hpx/executors/thread_pool_continues_on_sender.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

Domain-optimized continues_on sender for HPX thread pool schedulers.

When stdexec::continues_on is applied with an HPX thread_pool_scheduler, the generic stdexec implementation creates two operation states: one for the source sender and one for the scheduler hop (schedule_from). This double-state overhead adds ~1 us per task in microbenchmarks.

This header provides a custom sender that replaces the generic path by:

  1. Connecting the source sender to a lightweight receiver that captures the downstream receiver and the scheduler.

  2. On set_value: if we are already on the same HPX thread pool, forwarding inline; otherwise, posting a single HPX task to forward the values.

This eliminates the intermediate __storage_for_t, the second operation state, and the run_loop overhead.

namespace hpx
namespace execution
namespace experimental