Zero  0.1.0
Public Attributes | List of all members
gc_pointer_raw Union Reference

A portable and logical pointer with mark-for-death, ABA counter, and generation/segement bits. More...

#include <w_gc_pool_forest.h>

Public Attributes

struct {
   gc_status   status
 
   gc_generation   generation
 
   gc_segment   segment
 
   gc_offset   offset
 
components
 
uint64_t word
 

Detailed Description

A portable and logical pointer with mark-for-death, ABA counter, and generation/segement bits.

Marked For Death

Same as MarkablePointer.

What it is for

As described in Chap 10.6 of [HERLIHY], there is the ABA problem. When we new/delete classes/structs, they reuse the same memory area. Hence, we need to make sure the same pointer is differentiable. The common solution is to implant some counter in the 64bit pointer like the mark for death. Intel64/AMD64 so far uses only 48 bits (http://en.wikipedia.org/wiki/X86-64), so we can steal the most significant 16 bits to store a stamp value. However, 16 bits is not perfect for avoiding ABA problems, but double-word CAS is quite environment dependant. So, we chose to implement our own logical pointer.

See also
GcPointer
http://stackoverflow.com/questions/19389243/stealing-bits-from-a-pointer
http://www.1024cores.net/home/lock-free-algorithms/tricks/pointer-packing

Member Data Documentation

§ components

struct { ... } gc_pointer_raw::components

§ generation

gc_generation gc_pointer_raw::generation

§ offset

gc_offset gc_pointer_raw::offset

§ segment

gc_segment gc_pointer_raw::segment

§ status

gc_status gc_pointer_raw::status

§ word

uint64_t gc_pointer_raw::word

Integer representation, which is handy for single-word CAS.


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