cds  2.3.2
cds::intrusive::cuckoo::refinable< RecursiveLock, Arity, BackOff, Alloc, Stat > Class Template Reference

Refinable concurrent access policy. More...

#include <cds/intrusive/cuckoo_set.h>

Public Types

typedef RecursiveLock lock_type
 lock type
 
typedef Alloc allocator_type
 allocator type
 
typedef BackOff back_off
 back-off strategy
 
typedef Stat statistics_type
 internal statistics type
 

Public Member Functions

 refinable (size_t nLockCount)
 Constructor. More...
 
size_t lock_count () const
 Returns lock array size. More...
 
constexpr unsigned int arity () const noexcept
 Returns the arity of refinable mutex policy.
 
statistics_type const & statistics () const
 Returns internal statistics.
 

Static Public Attributes

static unsigned int const c_nArity = Arity
 the arity
 

Detailed Description

template<class RecursiveLock = std::recursive_mutex, unsigned int Arity = 2, typename BackOff = cds::backoff::Default, class Alloc = CDS_DEFAULT_ALLOCATOR, class Stat = empty_refinable_stat>
class cds::intrusive::cuckoo::refinable< RecursiveLock, Arity, BackOff, Alloc, Stat >

Refinable concurrent access policy.

This is one of available opt::mutex_policy option type for CuckooSet

Refining is like a striping technique (see cuckoo::striping) but it allows growing the size of lock array when resizing the hash table. So, the sizes of hash table and lock array are equal.

Template arguments:

  • RecursiveLock - the type of mutex. Reentrant (recursive) mutex is required. The default is std::recursive_mutex. The mutex type should be default-constructible.
  • Arity - unsigned int constant that specifies an arity. The arity is the count of hash functors, i.e., the count of lock arrays. Default value is 2.
  • BackOff - back-off strategy. Default is cds::backoff::Default
  • Alloc - allocator type used for lock array memory allocation. Default is CDS_DEFAULT_ALLOCATOR.
  • Stat - internal statistics type. Note that this template argument is automatically selected by CuckooSet class according to its opt::stat option.

Constructor & Destructor Documentation

◆ refinable()

template<class RecursiveLock = std::recursive_mutex, unsigned int Arity = 2, typename BackOff = cds::backoff::Default, class Alloc = CDS_DEFAULT_ALLOCATOR, class Stat = empty_refinable_stat>
cds::intrusive::cuckoo::refinable< RecursiveLock, Arity, BackOff, Alloc, Stat >::refinable ( size_t  nLockCount)
inline

Constructor.

Parameters
nLockCountThe size of lock array. Must be power of two.

Member Function Documentation

◆ lock_count()

template<class RecursiveLock = std::recursive_mutex, unsigned int Arity = 2, typename BackOff = cds::backoff::Default, class Alloc = CDS_DEFAULT_ALLOCATOR, class Stat = empty_refinable_stat>
size_t cds::intrusive::cuckoo::refinable< RecursiveLock, Arity, BackOff, Alloc, Stat >::lock_count ( ) const
inline

Returns lock array size.

Lock array size is not a constant for refinable policy and can be changed when the set is resized.


The documentation for this class was generated from the following file:

cds 2.3.2 Developed by Maxim Khizhinsky aka khizmax and other contributors 2007 - 2017
Autogenerated Sun Dec 31 2017 12:10:41 by Doxygen 1.8.13