|
cds
1.4.0
|
Different backoff schemes. More...
Data Structures | |
| struct | empty |
| Empty backoff strategy. Do nothing. More... | |
| struct | yield |
| Switch to another thread (yield). Good for thread preemption architecture. More... | |
| struct | pause |
| Random pause. More... | |
| struct | hint |
| Processor hint back-off. More... | |
| class | exponential |
| Exponential back-off. More... | |
Typedefs | |
| typedef exponential< hint, yield > | Default |
| Default backoff strategy. | |
| typedef exponential< hint, yield > | LockDefault |
| Default back-off strategy for lock primitives. | |
Different backoff schemes.
Back-off schema may be used in lock-free algorithms when the algorithm cannot perform some action because a conflict with the other concurrent operation is encountered. In this case current thread can do another work or can call processor's performance hint.
The interface of back-off strategy is following:
operator() operator calls back-off strategy's action. It is main part of back-off strategy.
reset() function resets internal state of back-off strategy to initial state. It is required for some back-off strategies, for example, exponential back-off.