|
cds
2.3.3
|
Lock-free free list based on tagged pointers (required double-width CAS) More...
#include <cds/intrusive/free_list_tagged.h>
Data Structures | |
| struct | node |
Public Member Functions | |
| TaggedFreeList () | |
| Creates empty free-list. | |
| ~TaggedFreeList () | |
| Destroys the free list. Free-list must be empty. More... | |
| void | put (node *pNode) |
Puts pNode to the free list. | |
| node * | get () |
Gets a node from the free list. If the list is empty, returns nullptr. | |
| bool | empty () const |
| Checks whether the free list is empty. | |
| template<typename Disposer > | |
| void | clear (Disposer disp) |
| Clears the free list (not atomic) More... | |
Lock-free free list based on tagged pointers (required double-width CAS)
This variant of FreeList is intended for processor architectures that support double-width CAS. It uses tagged pointer technique to solve ABA problem.
How to use
|
inline |
Destroys the free list. Free-list must be empty.
clear() with an appropriate disposer.
|
inline |
Clears the free list (not atomic)
For each element disp disposer is called to free memory. The Disposer interface:
This method must be explicitly called before the free list destructor.