Honeycomb
0.1
Component-Model Framework
|
Lock-free memory manager, provides safe memory reclamation for concurrent algorithms. More...
#include <HazardMem.h>
Public Types | |
typedef Config::Node | Node |
typedef Config::Link | Link |
typedef Config::Alloc::template rebind< Node >::other | Alloc |
Public Member Functions | |
HazardMem (Config &config, const Alloc &alloc, int threadMax) | |
template<class... Args> | |
Node & | createNode (Args &&...args) |
void | deleteNode (Node &node) |
Node * | deRefLink (Link &link) |
Dereference a link, protects with hazard pointer. May return null. More... | |
void | ref (Node &node) |
Add reference to node, sets up hazard pointer. More... | |
void | releaseRef (Node &node) |
Release a reference to a node, clears hazard pointer. More... | |
bool | casRef (Link &link, const Link &val, const Link &old) |
Compare and swap link. Set link in a concurrent environment. Returns false if the link was changed by another thread. More... | |
void | storeRef (Link &link, const Link &val) |
Set link in a single-threaded environment. More... | |
Lock-free memory manager, provides safe memory reclamation for concurrent algorithms.
Based on the paper: "Efficient and Reliable Lock-Free Memory Reclamation Based on Reference Counting", Gidenstam, et al. - 2005
typedef Config::Alloc::template rebind<Node>::other honey::lockfree::HazardMem< Config >::Alloc |
typedef Config::Link honey::lockfree::HazardMem< Config >::Link |
typedef Config::Node honey::lockfree::HazardMem< Config >::Node |
|
inline |
config | |
alloc | |
threadMax | Max number of threads that can access the memory manager. Use a thread pool and ensure that it has a longer life cycle than the mem manager. |
|
inline |
Compare and swap link. Set link in a concurrent environment. Returns false if the link was changed by another thread.
|
inline |
|
inline |
|
inline |
Dereference a link, protects with hazard pointer. May return null.
|
inline |
Add reference to node, sets up hazard pointer.
|
inline |
Release a reference to a node, clears hazard pointer.
|
inline |
Set link in a single-threaded environment.