Tervel  1.0.0
A collection of wait-free containers and algorithms.
Public Member Functions | Public Attributes | Friends | List of all members
tervel::algorithms::wf::mcas::CasRow< T > Class Template Reference

This class is used to represent a one of the M CAS operations performed by an MCAS operation. More...

#include <mcas_casrow.h>

Public Member Functions

 CasRow ()
 
 CasRow (std::atomic< T > *address, T expected_value, T new_value)
 
 ~CasRow ()
 

Public Attributes

std::atomic< T > * address_
 
expected_value_
 
new_value_
 
std::atomic< Helper< T > * > helper_
 

Friends

bool operator< (const CasRow< T > &a, const CasRow< T > &b)
 
bool operator> (const CasRow< T > &a, const CasRow< T > &b)
 
bool operator== (const CasRow< T > &a, const CasRow< T > &b)
 
bool operator!= (const CasRow< T > &a, const CasRow< T > &b)
 
void swap (CasRow &a, CasRow &b)
 This funciton is used when the MCAS operation is sorted to re-arrange the CasRows so they are sorted in a decsending manner. More...
 

Detailed Description

template<class T>
class tervel::algorithms::wf::mcas::CasRow< T >

This class is used to represent a one of the M CAS operations performed by an MCAS operation.

It holds an address, expected value and new value for that address.

Constructor & Destructor Documentation

template<class T>
tervel::algorithms::wf::mcas::CasRow< T >::CasRow ( )
inline
template<class T>
tervel::algorithms::wf::mcas::CasRow< T >::CasRow ( std::atomic< T > *  address,
expected_value,
new_value 
)
inline
template<class T>
tervel::algorithms::wf::mcas::CasRow< T >::~CasRow ( )
inline

Friends And Related Function Documentation

template<class T>
bool operator!= ( const CasRow< T > &  a,
const CasRow< T > &  b 
)
friend
template<class T>
bool operator< ( const CasRow< T > &  a,
const CasRow< T > &  b 
)
friend
template<class T>
bool operator== ( const CasRow< T > &  a,
const CasRow< T > &  b 
)
friend
template<class T>
bool operator> ( const CasRow< T > &  a,
const CasRow< T > &  b 
)
friend
template<class T>
void swap ( CasRow< T > &  a,
CasRow< T > &  b 
)
friend

This funciton is used when the MCAS operation is sorted to re-arrange the CasRows so they are sorted in a decsending manner.

Sorting is important to prevent cyclic dependices between MCAS operations. We choose descedning as a secondary bound on the number of MCAS operations. That could interfer with this operation.

Member Data Documentation

template<class T>
std::atomic<T>* tervel::algorithms::wf::mcas::CasRow< T >::address_
template<class T>
T tervel::algorithms::wf::mcas::CasRow< T >::expected_value_
template<class T>
std::atomic<Helper<T> *> tervel::algorithms::wf::mcas::CasRow< T >::helper_
template<class T>
T tervel::algorithms::wf::mcas::CasRow< T >::new_value_

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