Function wasmer_wasix::syscalls::maybe_backoff

source ยท
pub(crate) fn maybe_backoff<M: MemorySize>(
    ctx: FunctionEnvMut<'_, WasiEnv>,
) -> Result<Result<FunctionEnvMut<'_, WasiEnv>, Errno>, WasiError>
Expand description

Exponentially increasing backoff of CPU usage

Under certain conditions the process will exponentially backoff using waits that either put the thread into a low usage state or even underload the thread completely when deep sleep is enabled

The use-case for this is to handle rogue WASM processes that generate excessively high CPU usage and need to be artificially throttled