execution 1.0.1
Portable task execution, timers, and process lifecycle
Loading...
Searching...
No Matches

ABI-stable task submission entry points for the shared executor core. More...

Typedefs

using stlab::stlab_v2_task_proc
 Function pointer type submitted through the shared executor ABI.

Functions

void stlab::stlab_v2_default_executor_submit (const unsigned char *task_abi_guard, const stlab_v2_task_concept *vtable, stlab_v2_task_proc invoke, void *source) noexcept
 Submits one task to the shared default-priority executor.
void stlab::stlab_v2_high_executor_submit (const unsigned char *task_abi_guard, const stlab_v2_task_concept *vtable, stlab_v2_task_proc invoke, void *source) noexcept
 Submits one task to the shared high-priority executor.
void stlab::stlab_v2_low_executor_submit (const unsigned char *task_abi_guard, const stlab_v2_task_concept *vtable, stlab_v2_task_proc invoke, void *source) noexcept
 Submits one task to the shared low-priority executor.
void stlab::stlab_v2_notify_default_executor_before_waiting () noexcept
 Notifies the shared default executor that the calling thread is about to wait.
std::int32_t stlab::stlab_v2_default_executor_supports_blocking () noexcept
 Returns one when the configured core supports blocking waits, otherwise zero.
void stlab::stlab_v2_main_executor_submit (const unsigned char *task_abi_guard, const stlab_v2_task_concept *vtable, stlab_v2_task_proc invoke, void *source) noexcept
 Submits one task to the main queue.
void stlab::stlab_v2_main_executor_run ()
 Keeps the main queue serviced; never returns.

Detailed Description

ABI-stable task submission entry points for the shared executor core.

Submitted targets must meet the queued-target lifecycle requirement in task.hpp. On threaded task systems, default/high/low executor tasks and their executed-target cleanup must not call pre_exit().

Typedef Documentation

◆ stlab_v2_task_proc

Function pointer type submitted through the shared executor ABI.

  • Precondition: task does not throw.

Function Documentation

◆ stlab_v2_default_executor_submit()

void stlab::v2::stlab_v2_default_executor_submit ( const unsigned char * task_abi_guard,
const stlab_v2_task_concept * vtable,
stlab_v2_task_proc invoke,
void * source )
noexcept

Submits one task to the shared default-priority executor.

  • Precondition: task_abi_guard points to execution_detail::current_task_storage_abi_guard::value.
  • Precondition: vtable and invoke are not nullptr.
  • Precondition: source is the relocation_source() of a live task<void() noexcept> sharing vtable/invoke, valid for the duration of this call.
  • Postcondition: exactly one invocation of the relocated target is scheduled.

◆ stlab_v2_high_executor_submit()

void stlab::v2::stlab_v2_high_executor_submit ( const unsigned char * task_abi_guard,
const stlab_v2_task_concept * vtable,
stlab_v2_task_proc invoke,
void * source )
noexcept

Submits one task to the shared high-priority executor.

  • Precondition: task_abi_guard points to execution_detail::current_task_storage_abi_guard::value.
  • Precondition: vtable and invoke are not nullptr.
  • Precondition: source is the relocation_source() of a live task<void() noexcept> sharing vtable/invoke, valid for the duration of this call.
  • Postcondition: exactly one invocation of the relocated target is scheduled.

◆ stlab_v2_low_executor_submit()

void stlab::v2::stlab_v2_low_executor_submit ( const unsigned char * task_abi_guard,
const stlab_v2_task_concept * vtable,
stlab_v2_task_proc invoke,
void * source )
noexcept

Submits one task to the shared low-priority executor.

  • Precondition: task_abi_guard points to execution_detail::current_task_storage_abi_guard::value.
  • Precondition: vtable and invoke are not nullptr.
  • Precondition: source is the relocation_source() of a live task<void() noexcept> sharing vtable/invoke, valid for the duration of this call.
  • Postcondition: exactly one invocation of the relocated target is scheduled.

◆ stlab_v2_main_executor_run()

void stlab::v2::stlab_v2_main_executor_run ( )

Keeps the main queue serviced; never returns.

  • Precondition: called at most once per process, from the thread the platform designates as main where it designates one on native platforms.
  • Postcondition: on Emscripten, the runtime remains live until code calls emscripten_force_exit() from outside a noexcept executor task, with the executable linked with -sEXIT_RUNTIME=1.

◆ stlab_v2_main_executor_submit()

void stlab::v2::stlab_v2_main_executor_submit ( const unsigned char * task_abi_guard,
const stlab_v2_task_concept * vtable,
stlab_v2_task_proc invoke,
void * source )
noexcept

Submits one task to the main queue.

  • Precondition: task_abi_guard points to execution_detail::current_task_storage_abi_guard::value.
  • Precondition: vtable and invoke are not nullptr.
  • Precondition: source is the relocation_source() of a live task<void() noexcept> sharing vtable/invoke, valid for the duration of this call.
  • Precondition: the target meets the queued-target lifecycle requirement in task.hpp.
  • Postcondition: exactly one invocation of the relocated target is scheduled on the main queue, normally after every task previously submitted from the calling thread. Cooperative retirement stages ordinary main submissions behind main work posted by draining producers.
  • Postcondition: main submission remains available after pre_exit().

◆ stlab_v2_notify_default_executor_before_waiting()

void stlab::v2::stlab_v2_notify_default_executor_before_waiting ( )
noexcept

Notifies the shared default executor that the calling thread is about to wait.

The portable task system may add a worker to preserve forward progress. Task systems with operating-system-managed blocking compensation perform no action. Cooperative task systems perform no action; callers must not block.