25 #ifndef TERVEL_CONTAINERS_WF_RINGBUFFER_RINGBUFFER_HELPER_IMP_H_
26 #define TERVEL_CONTAINERS_WF_RINGBUFFER_RINGBUFFER_HELPER_IMP_H_
34 namespace containers {
40 on_watch(std::atomic<void *> *address,
void *expected) {
42 SlotID pos = SlotID::SHORTUSE2;
50 res = address->compare_exchange_strong(expected, val);
53 void *temp =
reinterpret_cast<void *
>(
55 if (expected == temp) {
56 address->compare_exchange_strong(expected, val);
61 expected = address->load();
62 assert(expected != reinterpret_cast<void *>(
HelperType(
this)));
64 reinterpret_cast<void *>(
75 return op_->associate(
this);
82 return op_->valid(
this);
89 uintptr_t res =
reinterpret_cast<uintptr_t
>(h);
109 return reinterpret_cast<Helper *
>(val);
116 #endif // TERVEL_CONTAINERS_WF_RINGBUFFER_RINGBUFFER_HELPER_IMP_H_
static Helper * getHelperType(uintptr_t val)
Definition: helper_imp.h:106
TODO(steven):
Definition: mcas.h:36
BufferOp * op_
Definition: helper.h:61
static uintptr_t DelayMarkValue(uintptr_t val)
Takes a uintptr_t and places a bitmark on the delayMark_lsb.
Definition: ring_buffer_imp.h:374
static bool watch(SlotID slot_id, Element *elem, std::atomic< void * > *address, void *expected, HazardPointer *const hazard_pointer=tervel::tl_thread_info->get_hazard_pointer())
This method is used to achieve a hazard pointer watch on the the based descr.
This is a non-blocking FIFO ring buffer design that was made wait-free by applying a progress assuran...
Definition: ring_buffer.h:73
void * associate()
Definition: helper_imp.h:74
static bool isHelperType(uintptr_t val)
Definition: helper_imp.h:97
bool on_watch(std::atomic< void * > *address, void *expected)
This function is used to achieve a strong watch on an Element.
Definition: helper_imp.h:40
static uintptr_t HelperType(Helper *h)
Returns a uintptr_t for the passed helper object.
Definition: helper_imp.h:88
bool valid()
Definition: helper_imp.h:81
SlotID
Definition: hazard_pointer.h:58