adaptive backoff for busy-wait loops, requires Rdtsc::calibrate ().
More...
#include <backoff.hpp>
|
| | Backoff (std::chrono::nanoseconds spin=std::chrono::microseconds(10), std::chrono::nanoseconds yield=std::chrono::microseconds(100), std::chrono::nanoseconds sleep=std::chrono::microseconds(50)) noexcept |
| | construct a backoff strategy.
|
| |
| void | operator() () noexcept |
| | execute one backoff iteration.
|
| |
| void | reset () noexcept |
| | reset backoff to initial state.
|
| |
| bool | spinExhausted () const noexcept |
| | check if initial spin phase is over.
|
| |
adaptive backoff for busy-wait loops, requires Rdtsc::calibrate ().
◆ Backoff()
| join::Backoff::Backoff |
( |
std::chrono::nanoseconds | spin = std::chrono::microseconds (10), |
|
|
std::chrono::nanoseconds | yield = std::chrono::microseconds (100), |
|
|
std::chrono::nanoseconds | sleep = std::chrono::microseconds (50) ) |
|
inlineexplicitnoexcept |
construct a backoff strategy.
- Parameters
-
| spin | spin duration. |
| yield | yield duration. |
| sleep | sleep per iteration, zero to never sleep. |
◆ operator()()
| void join::Backoff::operator() |
( |
| ) |
|
|
inlinenoexcept |
execute one backoff iteration.
◆ reset()
| void join::Backoff::reset |
( |
| ) |
|
|
inlinenoexcept |
reset backoff to initial state.
◆ spinExhausted()
| bool join::Backoff::spinExhausted |
( |
| ) |
const |
|
inlinenoexcept |
check if initial spin phase is over.
- Returns
- true if initial spin phase is over.
The documentation for this class was generated from the following file: