|
Zero
0.1.0
|
Garbage-collected Object-Pool Forests as in [JUNG13]. More...
Classes | |
| union | gc_pointer_raw |
| A portable and logical pointer with mark-for-death, ABA counter, and generation/segement bits. More... | |
| struct | GcSegment< T > |
| A segment in each generation. More... | |
| struct | GcGeneration< T > |
| A generation of objects. More... | |
| struct | GcPoolEntry |
| struct | GcWakeupFunctor |
| struct | GcPoolForest< T > |
| Garbage-collected Pool Forest. More... | |
Typedefs | |
| typedef int32_t | gc_status |
| Status bits in gc_pointer. More... | |
| typedef uint32_t | gc_aba |
| typedef uint8_t | gc_generation |
| typedef uint8_t | gc_segment |
| typedef uint16_t | gc_offset |
| typedef uint64_t | gc_thread_id |
Garbage-collected Object-Pool Forests as in [JUNG13].
We maintain a forest of object pools with garbage-collector for each type of object. Such an object pool is quite effective to address the following issues in lock-free algorithms:
The usual drawback of this approach is that there are few one-size-fits-all GC design, so it has either unwanted overheads or some restrictions on users. However, this is our Roll-Your-Own Garbage Collector implementation optimized for long-running services with small number of object types, such as filesystems and databases.
Rather than general and more advanced techniques such as Hazard Pointers, this is much more simple, robust, efficient, and satisfactory for our usecase.
The GC Forest consists of the following three levels.
All the classes are header-only template classes. Just include w_gc_pool_forest.h to use.
| typedef uint32_t gc_aba |
ABA counter bits in gc_pointer.
| typedef uint8_t gc_generation |
Generation bits in gc_pointer (0 means an invalid generation = NULL).
| typedef uint16_t gc_offset |
Offset bits in gc_pointer (not in bytes but in objects).
| typedef uint8_t gc_segment |
Segment bits in gc_pointer.
| typedef int32_t gc_status |
Status bits in gc_pointer.
This is logically not part of the pointer, but additional bits for lock-free algorithms.
| typedef uint64_t gc_thread_id |
Identifier of threads (which might be pthread_self() or something else).
1.8.12