Quick Links: |
Provide common implementation of striped un-ordered map/multimap. More...
Namespaces | |
namespace | bdlcc |
bdlcc::StripedUnorderedContainerImpl | striped container for key-value types |
a common implementation for bdlcc::StripedUnorderedMap
and bdlcc::StripedUnorderedMultiMap
, that are concurrent (fully thread-safe) associative containers that partition their underlying hash tables into a (user-defined) number of "bucket groups" and control access to each part of their hash tables by separate read-write locks. For most methods, the "map" and "multimap" classes forward to the analogous method in this "impl" class with an additional argument that specifies if the calling class has unique keys or not.
bdlcc::StripedUnorderedContrainerImpl
class template is fully thread-safe (see bsldoc_glossary
|Fully Thread-Safe), assuming that the allocator is fully thread-safe. Each method is executed by the calling thread. +----------------------------------------------------+--------------------+ | Operation | Complexity | +====================================================+====================+ | insert, setValue, setComputedValue, update | Average: O[1] | | | Worst: O[n] | +----------------------------------------------------+--------------------+ | erase, getValue | Average: O[1] | | | Worst: O[n] | +----------------------------------------------------+--------------------+ | visit(key, visitor) | Average: O[1] | | visitReadOnly(key, visitor) | Worst: O[n] | +----------------------------------------------------+--------------------+ | insertBulk, k elements | Average: O[k] | | | Worst: O[n*k] | +----------------------------------------------------+--------------------+ | eraseBulk, k elements | Average: O[k] | | | Worst: O[n*k] | +----------------------------------------------------+--------------------+ | rehash | O[n] | +----------------------------------------------------+--------------------+ | visit(visitor), visitReadOnly(visitor) | O[n] | +----------------------------------------------------+--------------------+
bucketCount() <= maxLoadFactor() * size();
size()
). maxLoadFactor(newMaxLoadFactor)
method. rehash
method. enableRehash
and disableRehash
methods are provided to control the rehash enable flag. Note that disabling rehash does not impact a rehash in progress.