cds  2.3.2
cds::intrusive::striped_set::refinable< RecursiveLock, BackOff, Alloc > Class Template Reference

Refinable concurrent access policy. More...

#include <cds/intrusive/striped_set/striping_policy.h>

Public Types

typedef RecursiveLock lock_type
 lock type
 
typedef BackOff back_off
 back-off strategy used
 
typedef Alloc allocator_type
 allocator type
 

Public Member Functions

 refinable (size_t nLockCount)
 Constructor. More...
 
size_t lock_count () const
 Returns lock array size. More...
 
void resize (size_t nNewCapacity)
 Resize for new capacity.
 

Detailed Description

template<class RecursiveLock = std::recursive_mutex, typename BackOff = cds::backoff::yield, class Alloc = CDS_DEFAULT_ALLOCATOR>
class cds::intrusive::striped_set::refinable< RecursiveLock, BackOff, Alloc >

Refinable concurrent access policy.

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

Refining is like a striping technique (see striped_set::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.
  • BackOff - back-off strategy. Default is cds::backoff::yield
  • Alloc - allocator type used for lock array memory allocation. Default is CDS_DEFAULT_ALLOCATOR.

Constructor & Destructor Documentation

◆ refinable()

template<class RecursiveLock = std::recursive_mutex, typename BackOff = cds::backoff::yield, class Alloc = CDS_DEFAULT_ALLOCATOR>
cds::intrusive::striped_set::refinable< RecursiveLock, BackOff, Alloc >::refinable ( size_t  nLockCount)
inline

Constructor.

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

Member Function Documentation

◆ lock_count()

template<class RecursiveLock = std::recursive_mutex, typename BackOff = cds::backoff::yield, class Alloc = CDS_DEFAULT_ALLOCATOR>
size_t cds::intrusive::striped_set::refinable< RecursiveLock, BackOff, Alloc >::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:48 by Doxygen 1.8.13