cds  2.3.2
cds::container::striped_set Namespace Reference

Striped hash set related definitions. More...

Data Structures

class  adapt
 Default adapter for hash set. More...
 

Typedefs

template<size_t LoadFactor>
using load_factor_resizing = cds::intrusive::striped_set::load_factor_resizing< LoadFactor >
 Load factor based resizing policy. More...
 
template<size_t Numerator, size_t Denominator = 1>
using rational_load_factor_resizing = cds::intrusive::striped_set::rational_load_factor_resizing< Numerator, Denominator >
 Rational load factor resizing policy. More...
 
template<size_t Threshold>
using single_bucket_size_threshold = cds::intrusive::striped_set::single_bucket_size_threshold< Threshold >
 Single bucket threshold resizing policy. More...
 
typedef cds::intrusive::striped_set::no_resizing no_resizing
 Dummy resizing policy. More...
 
template<class Lock = std::mutex, class Alloc = CDS_DEFAULT_ALLOCATOR>
using striping = cds::intrusive::striped_set::striping< Lock, Alloc >
 Lock striping concurrent access policy. More...
 
template<class RecursiveLock = std::recursive_mutex, typename BackOff = cds::backoff::yield, class Alloc = CDS_DEFAULT_ALLOCATOR>
using refinable = cds::intrusive::striped_set::refinable< RecursiveLock, BackOff, Alloc >
 Refinable concurrent access policy. More...
 

Detailed Description

Striped hash set related definitions.

Typedef Documentation

◆ load_factor_resizing

Load factor based resizing policy.

When total item count in a container exceeds container.bucket_count() * LoadFactor then resizing is needed.

This policy is stateless.

The reset() function is called after the resizing is done. The function is intended for resetting internal state of the policy.

◆ no_resizing

Dummy resizing policy.

This policy is dummy and always returns false that means no resizing is needed.

This policy is stateless.

◆ rational_load_factor_resizing

template<size_t Numerator, size_t Denominator = 1>
using cds::container::striped_set::rational_load_factor_resizing = typedef cds::intrusive::striped_set::rational_load_factor_resizing<Numerator, Denominator>

Rational load factor resizing policy.

When total item count in a container exceeds container.bucket_count() * Numerator / Denominator then resizing is needed.

This policy is stateless: Numerator and Denominator specifies in compile time as template arguments

◆ refinable

template<class RecursiveLock = std::recursive_mutex, typename BackOff = cds::backoff::yield, class Alloc = CDS_DEFAULT_ALLOCATOR>
using cds::container::striped_set::refinable = typedef 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.

◆ single_bucket_size_threshold

Single bucket threshold resizing policy.

If any single bucket size exceeds the global Threshold then resizing is needed.

This policy is stateless.

◆ striping

template<class Lock = std::mutex, class Alloc = CDS_DEFAULT_ALLOCATOR>
using cds::container::striped_set::striping = typedef cds::intrusive::striped_set::striping<Lock, Alloc>

Lock striping concurrent access policy.

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

Lock striping is very simple technique. The set consists of the bucket table and the array of locks. Initially, the capacity of lock array and bucket table is the same. When set is resized, bucket table capacity will be doubled but lock array will not. The lock i protects each bucket j, where j = i mod L , where L - the size of lock array.

The policy contains an internal array of Lock locks.

Template arguments:

  • Lock - the type of mutex. The default is std::mutex. The mutex type should be default-constructible. Note that a spin-lock is not so good suitable for lock striping for performance reason.
  • Alloc - allocator type used for lock array memory allocation. Default is CDS_DEFAULT_ALLOCATOR.

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