Tervel
1.0.0
A collection of wait-free containers and algorithms.
|
This class represents the progress assurance scheme employed by our library. More...
#include <progress_assurance.h>
Classes | |
class | Limit |
Public Member Functions | |
ProgressAssurance (size_t num_threads) | |
Static Public Member Functions | |
static void | check_for_announcement (ProgressAssurance *const progress_assuarance=nullptr) |
This function checks at most one position in the op_table_ for an OPRecod If one is found it will call its help_complete function. More... | |
static void | make_announcement (OpRecord *op, const uint64_t tid=tervel::tl_thread_info->get_thread_id(), ProgressAssurance *const prog_assur=tervel::tl_thread_info->get_progress_assurance()) |
This function places the. More... | |
Static Public Attributes | |
static constexpr size_t | HELP_DELAY = TERVEL_PROG_ASSUR_DELAY |
Const used to delay an announcement. More... | |
Private Member Functions | |
void | p_check_for_announcement (size_t &hpos) |
This function checks at most one position in the op_table_ for an OPRecod If one is found it will call its help_complete function. More... | |
void | p_make_announcement (OpRecord *op, const uint64_t tid=tervel::tl_thread_info->get_thread_id()) |
This function places the. More... | |
DISALLOW_COPY_AND_ASSIGN (ProgressAssurance) | |
Private Attributes | |
std::unique_ptr< std::atomic< OpRecord * >[]> | op_table_ |
Table for storing operation records, each thread has its own position that corresponds to its thread if. More... | |
const size_t | num_threads_ |
The number of threads that are using this operation table. More... | |
This class represents the progress assurance scheme employed by our library.
For this scheme to be effective, each operation which may indefinitely prevent the progress of some other operation must call the static function offer_help This ensures that if a thread is continually failing its operation, then after a finite number of tries all thread will be helping. The number of failures is MAX_FAILURES + (number of threads^2)* help_delay
|
inlineexplicit |
|
inlinestatic |
This function checks at most one position in the op_table_ for an OPRecod If one is found it will call its help_complete function.
help_id_ is a variable used to track which thread to check for an announcement.
delay_count_ is a variable used to delay how often a thread checks for an annoucnement
|
private |
|
inlinestatic |
|
private |
This function checks at most one position in the op_table_ for an OPRecod If one is found it will call its help_complete function.
|
private |
|
static |
Const used to delay an announcement.
Const used to reduce the number of times a thread checks the table Reduces memory loads at the cost of a higher upper bound
|
private |
The number of threads that are using this operation table.
|
private |
Table for storing operation records, each thread has its own position that corresponds to its thread if.