25 #ifndef TERVEL_MCAS_MCAS_H_
26 #define TERVEL_MCAS_MCAS_H_
37 namespace algorithms {
47 inline T
read(std::atomic<T> *address) {
49 return reinterpret_cast<T
>(value);
75 if (helper ==
reinterpret_cast<Helper<T> *
>(MCAS_FAIL_CONST)) {
97 bool add_cas_triple(std::atomic<T> *address, T expected_value, T new_value);
129 if (helper ==
reinterpret_cast<Helper<T> *
>(MCAS_FAIL_CONST)) {
214 #endif // TERVEL_MCAS_MCAS_H_
T mcas_remove(const int pos, T value)
This function insures that upon its return that *(cas_rows_[pos].address) no longer equals value...
Definition: mcas_imp.h:223
This class is used to represent a one of the M CAS operations performed by an MCAS operation...
Definition: mcas_casrow.h:45
void help_complete()
THis function overrides the virtual function in the OpRecord class It is called by the progress assur...
Definition: mcas.h:112
void free_descriptor(tervel::util::Descriptor *descr, bool dont_check=false)
Once a user is done with a descriptor, they should free it with this method.
Definition: descriptor_util.h:65
TODO(steven):
Definition: mcas.h:36
int max_rows_
Definition: mcas.h:201
bool add_cas_triple(std::atomic< T > *address, T expected_value, T new_value)
This function is used to add a CAS triple to the MCAS operation.
Definition: mcas_imp.h:35
int row_count_
Definition: mcas.h:199
MCasState
This enum is used to indicate the state of an mcas operation DELETED is used in debugging procedures...
Definition: mcas.h:143
bool execute()
This function is called after all the CAS triples have been added to the operation.
Definition: mcas_imp.h:72
std::atomic< MCasState > state_
Definition: mcas.h:197
MultiWordCompareAndSwap class is used to perform a Multi-Word Compare-and-Swap (MCAS) To execute an M...
Definition: mcas.h:61
static constexpr void * MCAS_FAIL_CONST
Definition: mcas.h:63
T read(std::atomic< T > *address)
This function determines the logical value of the address.
Definition: mcas.h:47
bool is_watched(tervel::util::Descriptor *descr)
This method is used to determine if the passed descriptor is under rc protection. ...
Definition: descriptor_util.h:78
bool mcas_complete(int start_pos, bool wfmode=false)
This function is used to complete a currently executing MCAS operation It is most likely that this op...
Definition: mcas_imp.h:90
void cleanup(bool success)
This function is used to cleanup a completed MCAS operation It removes each MCH placed during this op...
Definition: mcas_imp.h:255
void * descriptor_read_first(std::atomic< void * > *address)
This function determines the logical value of an address which may have either a RC descriptor or a n...
Definition: descriptor_util.h:233
This class is used to create Operation Records.
Definition: progress_assurance.h:52
std::unique_ptr< CasRow< T >[]> cas_rows_
Definition: mcas.h:195
This class is the MCAS operation's helper.
Definition: mcas_casrow.h:37
bool on_is_watched()
This function overrides the virtual function in the HP::Element class It returns whether or not this ...
Definition: mcas.h:124