#[non_exhaustive]pub enum TimerBackend {
SleepSlice,
Condvar,
}Expand description
Which primitive the process-wide release thread waits on.
Descriptive, not a knob: the wheel picks the best available backend and
records what it got. MOQTAP_RELEASE_TIMER overrides it only to
diagnose a host.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SleepSlice
One dedicated OS thread sleeping in SLICE-bounded
std::thread::sleep steps and parking on an untimed Condvar
when no deadline is armed. The backend on every platform, and
sub-millisecond on all of them: measured p50 lateness
0.11-0.17 ms, p95 0.52-0.57 ms on Windows 11.
Condvar
std::sync::Condvar::wait_timeout, reachable only by setting
MOQTAP_RELEASE_TIMER=condvar. Precise on Unix, where it is
backed by a CLOCK_MONOTONIC hrtimer; on Windows it is bounded
below by the ~15.6 ms system tick (measured p50 lateness
12.26 ms for a 3 ms deadline) and is the forced-diagnosis backend
rather than a fallback.
Implementations§
Source§impl TimerBackend
impl TimerBackend
Sourcepub const fn is_high_resolution(self) -> bool
pub const fn is_high_resolution(self) -> bool
Whether this backend can resolve delays below the ~15.6 ms Windows system tick.
SleepSlice => true on every platform. Condvar => cfg!(unix) —
platform-dependent, because it is the good primitive on Unix and
the degraded one on Windows, and the type says so rather than the
reader having to know.