Skip to main content

Module async_ops

Module async_ops 

Source
Expand description

FFI Trampolines for Async Task Operations

These extern “C” functions are called from JIT-compiled code to interact with the async task scheduler (spawn, join, cancel, scopes).

v2-boundary: All functions in this module are called from translator/opcodes/async_ops.rs and registered in ffi_symbols/async_symbols.rs.

Deleted (no callers from MirToIR):

  • Simulation event scheduling (__shape_schedule_event, EventQueueOpaque, etc.)
  • Cooperative yield/suspend (__shape_should_yield, __shape_yield, __shape_suspend, etc.)
  • Event queue polling (__shape_poll_event, __shape_emit_event, __shape_emit_alert)
  • Suspension state inspection (__shape_get_suspension_state, __shape_set_yield_threshold)

Constants§

SUSPENSION_ASYNC_WAIT
Suspension state for async-wait (JoinAwait returns this to signal the JIT execution loop should hand control back to the interpreter).

Statics§

ASYNC_SCOPE_ENTER_FN
Async scope enter trampoline: fn()
ASYNC_SCOPE_EXIT_FN
Async scope exit trampoline: fn()
CANCEL_TASK_FN
Cancel trampoline: fn(future_bits: u64)
SPAWN_TASK_FN
Spawn trampoline: fn(callable_bits: u64) -> u64 (returns Future bits)

Functions§

jit_async_scope_enter
Enter an async scope (structured concurrency boundary).
jit_async_scope_exit
Exit an async scope (structured concurrency boundary).
jit_cancel_task
Cancel a running task by its future ID.
jit_join_await
Await a task group, suspending JIT execution.
jit_join_init
Initialize a join group from task futures.
jit_spawn_task
Spawn a new async task.
register_async_task_fns⚠
Register all async task trampolines.
unregister_async_task_fns
Clear all async task trampoline registrations.