W3cubDocs

/Rust

Function std::sync::atomic::hint_core_should_pause

pub fn hint_core_should_pause()
🔬 This is a nightly-only experimental API. (hint_core_should_pause #41196)

Save power or switch hyperthreads in a busy-wait spin-loop.

This function is deliberately more primitive than std::thread::yield_now and does not directly yield to the system's scheduler. In some cases it might be useful to use a combination of both functions. Careful benchmarking is advised.

On some platforms this function may not do anything at all.

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/sync/atomic/fn.hint_core_should_pause.html