cds
2.3.2
|
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. | |
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::yieldAlloc
- allocator type used for lock array memory allocation. Default is CDS_DEFAULT_ALLOCATOR
.
|
inline |
Constructor.
nLockCount | Initial size of lock array. Must be power of two. |
|
inline |
Returns lock array size.
Lock array size is not a constant for refinable
policy and can be changed when the set is resized.