Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Class that implements exponential backoff. More...
#include <tbb_machine.h>
Public Member Functions | |
atomic_backoff () | |
atomic_backoff (bool) | |
void | pause () |
Pause for a while. More... | |
bool | bounded_pause () |
Pause for a few times and return false if saturated. More... | |
void | reset () |
Private Attributes | |
int32_t | count |
Static Private Attributes | |
static const int32_t | LOOPS_BEFORE_YIELD = 16 |
Time delay, in units of "pause" instructions. More... | |
Additional Inherited Members | |
![]() | |
no_copy (const no_copy &)=delete | |
no_copy ()=default | |
Class that implements exponential backoff.
See implementation of spin_wait_while_eq for an example.
Definition at line 345 of file tbb_machine.h.
|
inline |
Definition at line 355 of file tbb_machine.h.
|
inline |
Definition at line 357 of file tbb_machine.h.
References pause().
|
inline |
Pause for a few times and return false if saturated.
Definition at line 372 of file tbb_machine.h.
References __TBB_Pause(), count, and LOOPS_BEFORE_YIELD.
Referenced by tbb::internal::prolonged_pause().
|
inline |
Pause for a while.
Definition at line 360 of file tbb_machine.h.
References __TBB_Pause(), __TBB_Yield, count, and LOOPS_BEFORE_YIELD.
Referenced by __TBB_AtomicAND(), __TBB_AtomicOR(), tbb::internal::__TBB_FetchAndAddGeneric(), tbb::internal::__TBB_FetchAndStoreGeneric(), __TBB_LockByte(), tbb::internal::__TBB_MaskedCompareAndSwap(), tbb::internal::generic_scheduler::acquire_task_pool(), atomic_backoff(), tbb::internal::concurrent_vector_base_v3::helper::extend_segment_table(), tbb::interface5::fetch_and_and(), tbb::interface5::fetch_and_or(), tbb::spin_rw_mutex_v3::internal_acquire_reader(), tbb::spin_rw_mutex_v3::internal_acquire_writer(), tbb::internal::concurrent_vector_base_v3::internal_grow_to_at_least_with_result(), tbb::internal::mail_outbox::internal_pop(), tbb::spin_rw_mutex_v3::internal_upgrade(), tbb::internal::micro_queue::push(), tbb::interface5::spin_wait_until_and(), tbb::internal::spin_wait_until_eq(), tbb::strict_ppl::internal::micro_queue< Value >::spin_wait_until_my_turn(), tbb::internal::spin_wait_while(), tbb::internal::spin_wait_while_eq(), and tbb::interface5::spin_wait_while_geq().
|
inline |
|
private |
Definition at line 350 of file tbb_machine.h.
Referenced by bounded_pause(), pause(), and reset().
|
staticprivate |
Time delay, in units of "pause" instructions.
Should be equal to approximately the number of "pause" instructions that take the same time as an context switch. Must be a power of two.
Definition at line 349 of file tbb_machine.h.
Referenced by bounded_pause(), and pause().