join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::Backoff Class Reference

adaptive backoff strategy for busy-wait loops. More...

#include <backoff.hpp>

Public Member Functions

 Backoff (size_t spin=200)
 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.
 

Detailed Description

adaptive backoff strategy for busy-wait loops.

Constructor & Destructor Documentation

◆ Backoff()

join::Backoff::Backoff ( size_t spin = 200)
inline

construct a backoff strategy.

Parameters
spinnumber of active spin iterations before yielding (default: 200).

Member Function Documentation

◆ 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: