native 0.0.1
Vectors, masks and wide register packs for C++26
Loading...
Searching...
No Matches
native.x86.wait Module Reference

Exported Modules

module  native.x86.features

Concepts

concept  native::waiter
 some way to wait for a value to change

Classes

struct  native::mwaitx
 waiter using the MONITORX/MWAITX instruction feature More...
struct  native::umwait
 waiter using the WAITPKG instruction feature More...
struct  native::spin
 A universally supported x86 spin waiter using PAUSE; monitor is a no-op. More...

Functions

template<waiter W>
void native::wait_until (volatile auto *p, auto f) noexcept(noexcept(!f(p)) &&noexcept(W::monitor(p)) &&noexcept(W::mwait(0))) native_blocking
 Wait until a predicate holds about a given memory location.
template<isa< x86 > Arch = NATIVE_BASELINE, unsigned Control = 1>
requires (Arch.has(x86_feature::waitpkg) && Control < 2)
std::uint8_t native::tpause (std::uint64_t deadline) noexcept native_blocking
auto native::with_waiter (auto k) noexcept(noexcept(k.template operator()<mwaitx >()) &&noexcept(k.template operator()<umwait >()) &&noexcept(k.template operator()<spin >()))
 finds an appropriate waiter for the current CPU Prefer MWAITX, then WAITPKG, otherwise PAUSE. Invoke k once with that type. Runtime detection occurs here, not in a SIMD arithmetic operation. Usage:

Files

file  src/native.x86.wait.ccm