|
| Helper (MCAS< T > *mcas_op, CasRow< T > *cas_row) |
| The Helper object contains a reference to the row it is associated with and the mcas operation that contains the row. More...
|
|
bool | on_watch (std::atomic< void * > *address, void *value) |
| This method is optional to implement for each sub class. More...
|
|
void * | complete (void *value, std::atomic< void * > *address) |
| This method is implemented by each sub class and must guarantee that upon return that the descriptor no longer exists at the address it was placed. More...
|
|
void * | get_logical_value () |
| This method is implemented by each sub class. More...
|
|
| Descriptor () |
|
virtual | ~Descriptor () |
|
virtual void | on_unwatch () |
| This method must be implemented if on_watch is implemented, and is optional otherwise. More...
|
|
virtual bool | on_is_watched () |
| This method is optional to implement for each sub class. More...
|
|
template<class T>
class tervel::algorithms::wf::mcas::Helper< T >
This class is the MCAS operation's helper.
The Helper or MCH is used to replace the expected value of the specified address.
This method is implemented by each sub class.
It returns the logical value of the past address. If the associated operation is still in progress then it will generally return the value that was replaced by this descriptor. Otherwise it will generally return the result of the operation for the specified address.
It can only be called from the static function which protects the object from being reused during the function.
Implements tervel::util::Descriptor.
This method is optional to implement for each sub class.
In the event there is a complex dependency between descriptor objects, where watching one implies performing other actions, such as watching a parent object, a developer will implement this function to encapsulate that logic
This function is called by the static watch function It should not watch itself.
- Parameters
-
address | The location to check. |
expected | The expected value for that location |
- Returns
- true if successful, false otherwise
Reimplemented from tervel::util::Descriptor.