Tervel  1.0.0
A collection of wait-free containers and algorithms.
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
tervel::util::ProgressAssurance Class Reference

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...
 

Detailed Description

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

Constructor & Destructor Documentation

tervel::util::ProgressAssurance::ProgressAssurance ( size_t  num_threads)
inlineexplicit

Member Function Documentation

static void tervel::util::ProgressAssurance::check_for_announcement ( ProgressAssurance *const  progress_assuarance = nullptr)
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

tervel::util::ProgressAssurance::DISALLOW_COPY_AND_ASSIGN ( ProgressAssurance  )
private
static void tervel::util::ProgressAssurance::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() 
)
inlinestatic

This function places the.

Parameters
opan OpRecord to complete
Returns
on return the OpRecord must be completed.
void tervel::util::ProgressAssurance::p_check_for_announcement ( size_t &  hpos)
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.

void tervel::util::ProgressAssurance::p_make_announcement ( OpRecord op,
const uint64_t  tid = tervel::tl_thread_info->get_thread_id() 
)
private

This function places the.

Parameters
opan OpRecord to complete
Returns
on return the OpRecord must be completed.

Member Data Documentation

constexpr size_t tervel::util::ProgressAssurance::HELP_DELAY = TERVEL_PROG_ASSUR_DELAY
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

const size_t tervel::util::ProgressAssurance::num_threads_
private

The number of threads that are using this operation table.

std::unique_ptr<std::atomic<OpRecord *>[]> tervel::util::ProgressAssurance::op_table_
private

Table for storing operation records, each thread has its own position that corresponds to its thread if.


The documentation for this class was generated from the following file: