pub struct WordWait { /* private fields */ }Available on AArch64 and Linux and crate feature
wordwait only.Expand description
This core’s word-wait capabilities, read once. A value is proof that the core has the
instructions WordWait::park executes, so the only way to get one is
WordWait::probe; it cannot be written by hand (in 0.1.0 the fields
were public, and a forged timed: true ran wfet on a core without FEAT_WFxT: SIGILL).
ⓘ
use gpu_async_reactor::backend::wordwait::WordWait;
let forged = WordWait { timed: true, counter_hz: 24_000_000 };use gpu_async_reactor::backend::wordwait::WordWait;
let w = WordWait::probe().expect("every aarch64 Linux core has ldxr + wfe");
assert!(w.counter_hz() > 0);
let _: bool = w.timed();Implementations§
Source§impl WordWait
impl WordWait
Sourcepub fn probe() -> Result<Self, &'static str>
pub fn probe() -> Result<Self, &'static str>
This CPU’s word wait, or why there is none. Probe once and keep the value.
§Errors
The CPU or target lacks a user-mode monitor/wait.
Sourcepub fn park(
&self,
line: &CompletionLine,
ready: impl Fn(&CompletionLine) -> bool,
bound: Duration,
) -> bool
pub fn park( &self, line: &CompletionLine, ready: impl Fn(&CompletionLine) -> bool, bound: Duration, ) -> bool
Park on line until ready(line) holds, a store to the line wakes the core, or bound
passes; returns ready(line). Any store to the line wakes the park, so one waiter can
watch every slot; a single-word wait is
ready = |l| l.words[slot].load(Acquire) == expect. May return false early.
Trait Implementations§
impl Copy for WordWait
impl Eq for WordWait
impl StructuralPartialEq for WordWait
Auto Trait Implementations§
impl Forget for WordWait
impl Freeze for WordWait
impl Move for WordWait
impl RefUnwindSafe for WordWait
impl Send for WordWait
impl Sync for WordWait
impl Unpin for WordWait
impl UnsafeUnpin for WordWait
impl UnwindSafe for WordWait
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more