In std::hint there's a spin_loop function with the following definition in its documentation:
Emits a machine instruction to signal the processor that it is running in a busy-wait spin-loop (“spin lock”).
Upon receiving the spin-loop signal the processor can optimize its behavior by, for example, saving power or switching hyper-threads.
Depending on the target architecture, this compiles to either:
_mm_pause, A.K.A. thepauseintrinsic on x86yieldinstruction on 32-bit armISB SYon 64-bit arm (aarch64)
That last one has got my head spinning a little bit (
