Skip to main content

Module levels

Module levels 

Source
Expand description

phase-509 P10 (RFC-0108) – the Rust tier runners’ level core: one executor per core, a worker per level. phase-509 P10 (RFC-0108 “As built in P9b”) – the Rust tier runners’ LEVEL core: one executor per core, a worker per level over it.

The C-ABI runners reach this through nros-cpp’s scheduler FFI (nros_cpp_level_open, nros_cpp_level_spin_once); a Rust runner holds the core’s ExecutorNodeRuntime itself and uses the same three steps:

  1. LevelCore::new – the boot level’s runtime, leaked for the image’s life, with the port’s recursive priority-inheriting mutex and the calling thread’s identity installed as the executor’s lock (nros_node::executor::exec_lock::ExecLock) when more than one level runs, the level count stated, and the boot level made current.

  2. LevelCore::open_level + LevelCore::with_runtime – on a level’s own thread: its worker record (leaked with the level), its waiter linked into the executor’s arrival routing, then the image’s setup run on the shared runtime with the level’s groups active and the level registering, all under the lock.

  3. LevelCore::spin_level_once / LevelCore::spin_boot_once – one pass of a level’s worker (its band, the lock released around each callback, then the ticks of the components its level registered) or of the boot level (the executor’s own worker: transport, executor-wide chores, the boot level’s component ticks). Issue 2020: a component ticks on the level that registered it, never on two.

  4. LevelCore::into_runtime – issue 2016: once every other level’s thread has stopped and been joined, the boot level takes the runtime back (the lock removed), so a hosted runner can close its session and return. An RTOS runner never calls it: its levels spin for the image’s life.

Every access goes through the raw runtime pointer with the lock taken first, so no reference to the runtime or its executor is live across another thread’s pass.

Structs§

LevelCore
The core’s runtime, shared by every level of the image. Copy: each level’s thread carries the handle.

Enums§

LevelError
Why a level could not be set up.