A portable and logical pointer with mark-for-death, ABA counter, and generation/segement bits.
More...
#include <w_gc_pool_forest.h>
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
§ components
| struct { ... } gc_pointer_raw::components |
§ generation
§ offset
§ segment
§ 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: