pub struct SchedTaskSetupGate { /* private fields */ }Expand description
The ONE gate a tier runner holds across each tier’s
open-and-setup so no two sched tasks declare entities on the shared session at
once.
Every sched task executor borrows the boot executor’s ONE RMW session, and a
sched task’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 the topic-binding scramble that
concurrent declares cause was measured. The RTOS runners serialize by CHAINING the
spawns (sched task N+1 starts only after sched task N’s setup returned);
a runner that spawns every sched task 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 SchedTaskSetupGate
impl SchedTaskSetupGate
Sourcepub fn enter(&self) -> SchedTaskSetupGuard<'_>
pub fn enter(&self) -> SchedTaskSetupGuard<'_>
Block until this caller holds the gate; it is released when the returned guard drops (on every return path, including a failed setup).