ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
Backoff.h

The exponential backoff of a thread that waits for a word of memory to change, beyond the book. More...

Files

file  ADS/concurrent/Backoff.h
 The exponential backoff of a thread that waits for a word of memory to change, beyond the book: the \( k \)-th call of pause() runs \( 2^{\min\{ k , S \}} \) pauses of the processor (pause on x86, yield on AArch64) while \( k \le S \), and from then on gives the processor back to the system (std::this_thread::yield()), so that a wait that ends soon costs no system call and one that lasts lets the other threads run; reset() starts again from one pause, after the wait has ended or the thread has done some work.

Classes

class  ADS::Backoff
 the exponential backoff of a waiting thread: \( 2^k \) pauses at the \( k \)-th call up to \( S \), then a yield to the system More...

Detailed description

The exponential backoff of a thread that waits for a word of memory to change, beyond the book.

The definitions, the invariants and the costs of the area are in Theory of concurrency.