Switching Executors

Page Contents

Switching Executors#

There are several ways to switch executors in the middle of a task.

The methods linked above are free functions. Additionally, many awaitable types also have a resume_on() method, which provides a way to switch executors when the awaitable is complete.

inline tmc::ex_any *tmc::current_executor() noexcept#

Returns a pointer to the current thread’s type-erased executor. Returns nullptr if this thread is not associated with an executor.