Target-dependent wait hints.
More...
#include <stddef.h>
#include <stdatomic.h>
Go to the source code of this file.
|
|
void | chic_yield (void) |
| | Yields the current thread execution, allowing other threads to run.
|
| static void | busy_wait_hint (void) |
| | Platform-dependent hint to the processor that it is in a busy-wait loop.
|
| static void | busy_wait_on (const void *addr) |
|
| atomic_size_t | chic_catastrophe_threshold |
| | Maximum number of permitted busy-wait loop iterations per send/recieve operation before the thread is yielded. Set to 1024 by default, but this can be overridden at runtime.
|
◆ busy_wait_hint()
| void busy_wait_hint |
( |
void | | ) |
|
|
inlinestatic |
Platform-dependent hint to the processor that it is in a busy-wait loop.
This helps optimize spinlocks by slowing down the processor a bit, which helps reduce contention on atomics.
- See also
- x86-64 pause
-
ARM64 isb (and why it is used instead of yield)
-
ARM32 yield
-
RISC-V pause
◆ busy_wait_on()
| void busy_wait_on |
( |
const void * | addr | ) |
|
|
inlinestatic |
- See also
- ref busy_wait_hint
-
RISC-V wrs
◆ chic_catastrophe_threshold
| atomic_size_t chic_catastrophe_threshold |
|
extern |
Maximum number of permitted busy-wait loop iterations per send/recieve operation before the thread is yielded. Set to 1024 by default, but this can be overridden at runtime.