proxygen
|
#include <ConcurrentSkipList.h>
Classes | |
class | Accessor |
class | Skipper |
Public Types | |
typedef detail::SkipListNode< T > | NodeType |
typedef T | value_type |
typedef T | key_type |
typedef detail::csl_iterator< value_type, NodeType > | iterator |
typedef detail::csl_iterator< const value_type, const NodeType > | const_iterator |
Public Member Functions | |
ConcurrentSkipList (int height, const NodeAlloc &alloc) | |
ConcurrentSkipList (int height) | |
~ConcurrentSkipList () | |
Static Public Member Functions | |
static Accessor | create (int height, const NodeAlloc &alloc) |
static Accessor | create (int height=1) |
static std::shared_ptr< SkipListType > | createInstance (int height, const NodeAlloc &alloc) |
static std::shared_ptr< SkipListType > | createInstance (int height=1) |
Private Types | |
typedef std::unique_lock< folly::MicroSpinLock > | ScopedLocker |
typedef ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT > | SkipListType |
Private Member Functions | |
size_t | size () const |
int | height () const |
int | maxLayer () const |
size_t | incrementSize (int delta) |
NodeType * | find (const value_type &data) |
bool | lockNodesForChange (int nodeHeight, ScopedLocker guards[MAX_HEIGHT], NodeType *preds[MAX_HEIGHT], NodeType *succs[MAX_HEIGHT], bool adding=true) |
template<typename U > | |
std::pair< NodeType *, size_t > | addOrGetData (U &&data) |
bool | remove (const value_type &data) |
const value_type * | first () const |
const value_type * | last () const |
int | findInsertionPointGetMaxLayer (const value_type &data, NodeType *preds[], NodeType *succs[], int *max_layer) const |
std::pair< NodeType *, int > | findNode (const value_type &data) const |
std::pair< NodeType *, int > | findNodeDownRight (const value_type &data) const |
std::pair< NodeType *, int > | findNodeRightDown (const value_type &data) const |
NodeType * | lower_bound (const value_type &data) const |
void | growHeight (int height) |
void | recycle (NodeType *node) |
Static Private Member Functions | |
static bool | greater (const value_type &data, const NodeType *node) |
static bool | less (const value_type &data, const NodeType *node) |
static int | findInsertionPoint (NodeType *cur, int cur_layer, const value_type &data, NodeType *preds[], NodeType *succs[]) |
static bool | okToDelete (NodeType *candidate, int layer) |
Private Attributes | |
detail::NodeRecycler< NodeType, NodeAlloc > | recycler_ |
std::atomic< NodeType * > | head_ |
std::atomic< size_t > | size_ |
Definition at line 145 of file ConcurrentSkipList.h.
typedef detail::csl_iterator<const value_type, const NodeType> folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::const_iterator |
Definition at line 161 of file ConcurrentSkipList.h.
typedef detail::csl_iterator<value_type, NodeType> folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::iterator |
Definition at line 160 of file ConcurrentSkipList.h.
typedef T folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::key_type |
Definition at line 158 of file ConcurrentSkipList.h.
typedef detail::SkipListNode<T> folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::NodeType |
Definition at line 156 of file ConcurrentSkipList.h.
|
private |
Definition at line 151 of file ConcurrentSkipList.h.
|
private |
Definition at line 153 of file ConcurrentSkipList.h.
typedef T folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::value_type |
Definition at line 157 of file ConcurrentSkipList.h.
|
inlineexplicit |
Definition at line 166 of file ConcurrentSkipList.h.
|
inlineexplicit |
Definition at line 171 of file ConcurrentSkipList.h.
|
inline |
Definition at line 201 of file ConcurrentSkipList.h.
References current, folly::detail::SkipListNode< T >::destroy(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::head_, folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::recycler_, and value.
|
inlineprivate |
Definition at line 314 of file ConcurrentSkipList.h.
References folly::detail::SkipListNode< T >::create(), folly::data(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findInsertionPointGetMaxLayer(), folly::detail::SkipListNode< T >::fullyLinked(), folly::detail::SkipListRandomHeight::getHeight(), folly::detail::SkipListRandomHeight::getSizeLimit(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::growHeight(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::height(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::incrementSize(), folly::detail::SkipListRandomHeight::instance(), k, folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::lockNodesForChange(), folly::detail::SkipListNode< T >::markedForRemoval(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::recycler_, folly::detail::SkipListNode< T >::setFullyLinked(), folly::detail::SkipListNode< T >::setSkip(), and UNLIKELY.
|
inlinestatic |
Definition at line 177 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::createInstance().
|
inlinestatic |
Definition at line 181 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::createInstance(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::height().
|
inlinestatic |
Definition at line 186 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::height().
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::create().
|
inlinestatic |
Definition at line 192 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::height().
|
inlineprivate |
Definition at line 268 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findNode().
|
inlinestaticprivate |
Definition at line 222 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::greater(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::less(), and folly::detail::SkipListNode< T >::skip().
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findInsertionPointGetMaxLayer(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::Skipper::to().
|
inlineprivate |
Definition at line 436 of file ConcurrentSkipList.h.
References folly::data(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findInsertionPoint(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::head_, and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::maxLayer().
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::addOrGetData(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::remove().
|
inlineprivate |
Definition at line 451 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findNodeDownRight().
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::find(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::lower_bound().
|
inlineprivate |
Definition at line 458 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::greater(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::head_, folly::detail::SkipListNode< T >::height(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::less(), and folly::detail::SkipListNode< T >::skip().
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findNode().
|
inlineprivate |
Definition at line 486 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::greater(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::head_, folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::less(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::maxLayer(), folly::detail::SkipListNode< T >::skip(), and folly::pushmi::top.
|
inlineprivate |
Definition at line 409 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::head_.
|
inlinestaticprivate |
Definition at line 214 of file ConcurrentSkipList.h.
References folly::data(), and folly::detail::SkipListNode< T >::data().
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findInsertionPoint(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findNodeDownRight(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findNodeRightDown(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::Skipper::to().
|
inlineprivate |
Definition at line 510 of file ConcurrentSkipList.h.
References folly::detail::SkipListNode< T >::acquireGuard(), folly::detail::SkipListNode< T >::copyHead(), folly::detail::SkipListNode< T >::create(), folly::detail::SkipListNode< T >::destroy(), g(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::head_, folly::detail::SkipListNode< T >::height(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::height(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::recycle(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::recycler_, and folly::detail::SkipListNode< T >::setMarkedForRemoval().
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::addOrGetData().
|
inlineprivate |
Definition at line 255 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::head_.
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::addOrGetData(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::create(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::createInstance(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::Skipper::curHeight(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::growHeight(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::lockNodesForChange(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::maxLayer(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::Skipper::operator++().
|
inlineprivate |
Definition at line 263 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::size_.
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::addOrGetData(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::remove().
|
inlineprivate |
Definition at line 414 of file ConcurrentSkipList.h.
References folly::detail::SkipListNode< T >::data(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::head_, folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::maxLayer(), and folly::detail::SkipListNode< T >::skip().
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::Accessor::pop_back().
|
inlinestaticprivate |
Definition at line 218 of file ConcurrentSkipList.h.
References folly::data(), and folly::detail::SkipListNode< T >::data().
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findInsertionPoint(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findNodeDownRight(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findNodeRightDown().
|
inlineprivate |
Definition at line 279 of file ConcurrentSkipList.h.
References folly::detail::SkipListNode< T >::acquireGuard(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::height(), folly::detail::SkipListNode< T >::markedForRemoval(), and folly::detail::SkipListNode< T >::skip().
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::addOrGetData(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::remove().
|
inlineprivate |
Definition at line 502 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findNode().
|
inlineprivate |
Definition at line 259 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::height().
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findInsertionPointGetMaxLayer(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findNodeRightDown(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::Skipper::init(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::last(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::Skipper::to().
|
inlinestaticprivate |
Definition at line 429 of file ConcurrentSkipList.h.
References folly::detail::SkipListNode< T >::fullyLinked(), folly::detail::SkipListNode< T >::markedForRemoval(), and folly::detail::SkipListNode< T >::maxLayer().
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::remove().
|
inlineprivate |
Definition at line 535 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::recycler_.
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::growHeight(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::remove().
|
inlineprivate |
Definition at line 367 of file ConcurrentSkipList.h.
References folly::detail::SkipListNode< T >::acquireGuard(), folly::data(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findInsertionPointGetMaxLayer(), folly::detail::SkipListNode< T >::height(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::incrementSize(), k, folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::lockNodesForChange(), folly::detail::SkipListNode< T >::markedForRemoval(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::okToDelete(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::recycle(), folly::detail::SkipListNode< T >::setMarkedForRemoval(), folly::detail::SkipListNode< T >::setSkip(), and folly::detail::SkipListNode< T >::skip().
|
inlineprivate |
Definition at line 251 of file ConcurrentSkipList.h.
References folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::size_.
|
private |
Definition at line 540 of file ConcurrentSkipList.h.
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findInsertionPointGetMaxLayer(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findNodeDownRight(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::findNodeRightDown(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::first(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::growHeight(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::height(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::last(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::~ConcurrentSkipList().
|
private |
Definition at line 539 of file ConcurrentSkipList.h.
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::addOrGetData(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::growHeight(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::Accessor::operator=(), folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::recycle(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::~ConcurrentSkipList().
|
private |
Definition at line 541 of file ConcurrentSkipList.h.
Referenced by folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::incrementSize(), and folly::ConcurrentSkipList< T, Comp, NodeAlloc, MAX_HEIGHT >::size().