pub struct TierSetupGate { /* private fields */ }Expand description
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
impl TierSetupGate
Sourcepub fn enter(&self) -> TierSetupGuard<'_>
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).