Skip to main content

TierSetupGate

Struct TierSetupGate 

Source
pub struct TierSetupGate { /* private fields */ }
Expand description

issue 1571 — the spawned tiers’ executor backing. nros::main! emits one TierExecutorBacking static per tiered entry and hands its slots to the board’s run_tiers, which refuses a short block through check_tier_executor_backing and opens each spawned tier with Executor::open_with_session_slot. Gated like the module it names (has_rmw + alloc in nros-node). Issue 1733 — the ONE gate a tier runner holds across each tier’s open-and-setup so no two tiers declare entities on the shared session at once.

Every tier executor borrows the boot executor’s ONE RMW session, and a tier’s setup declares its nodes and entities on it. The backend’s entity-creation path is not reentrant across threads: zenoh’s ZenohSession::create_* takes &mut self and mutates the per-node liveliness table, and issue 0447 measured the topic-binding scramble that concurrent declares cause. The RTOS runners serialize by CHAINING the spawns (issue #144: tier N+1 starts only after tier N’s setup returned); a runner that spawns every tier at once holds this instead. Setup runs once per boot and off the hot path, so a sleeping spin costs nothing that matters, and the spin loops that follow stay fully concurrent.

no_std and allocation-free (one atomic flag), so the same gate serves the native C++ runner (nros-cpp), the Linux Rust runner and the NuttX Rust runner. The backoff sleeps through the platform ABI, never spins hot: a waiter that outranks the holder under SCHED_FIFO would otherwise starve it on one CPU.

Implementations§

Source§

impl TierSetupGate

Source

pub const fn new() -> TierSetupGate

An open gate.

Source

pub fn enter(&self) -> TierSetupGuard<'_>

Block until this caller holds the gate; it is released when the returned guard drops (on every return path, including a failed setup).

Trait Implementations§

Source§

impl Debug for TierSetupGate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for TierSetupGate

Source§

fn default() -> TierSetupGate

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.