Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
base class of concurrent_hash_map More...
#include <concurrent_hash_map.h>
Classes | |
struct | bucket |
Bucket type. More... | |
struct | enable_segment_failsafe |
Exception safety helper. More... | |
Public Types | |
typedef size_t | size_type |
Size type. More... | |
typedef size_t | hashcode_t |
Type of a hash code. More... | |
typedef size_t | segment_index_t |
Segment index type. More... | |
typedef hash_map_node_base | node_base |
Node base type. More... | |
typedef bucket * | segment_ptr_t |
Segment pointer. More... | |
typedef segment_ptr_t | segments_table_t[pointers_per_table] |
Segment pointers table type. More... | |
Public Member Functions | |
hash_map_base () | |
Constructor. More... | |
template<typename Allocator > | |
void | enable_segment (segment_index_t k, const Allocator &allocator, bool is_initial=false) |
Enable segment. More... | |
template<typename Allocator > | |
void | delete_segment (segment_index_t s, const Allocator &allocator) |
bucket * | get_bucket (hashcode_t h) const throw () |
Get bucket by (masked) hashcode. More... | |
void | mark_rehashed_levels (hashcode_t h) throw () |
bool | check_mask_race (const hashcode_t h, hashcode_t &m) const |
Check for mask race. More... | |
bool | check_rehashing_collision (const hashcode_t h, hashcode_t m_old, hashcode_t m) const |
Process mask race, check for rehashing collision. More... | |
segment_index_t | insert_new_node (bucket *b, node_base *n, hashcode_t mask) |
Insert a node and check for load factor. More... | |
template<typename Allocator > | |
void | reserve (size_type buckets, const Allocator &allocator) |
Prepare enough segments for number of buckets. More... | |
void | internal_swap (hash_map_base &table) |
Swap hash_map_bases. More... | |
void | internal_move (hash_map_base &&other) |
Static Public Member Functions | |
static segment_index_t | segment_index_of (size_type index) |
static segment_index_t | segment_base (segment_index_t k) |
static size_type | segment_size (segment_index_t k) |
static bool | is_valid (void *ptr) |
static void | init_buckets (segment_ptr_t ptr, size_type sz, bool is_initial) |
Initialize buckets. More... | |
static void | add_to_bucket (bucket *b, node_base *n) |
Add node. More... | |
Public Attributes | |
atomic< hashcode_t > | my_mask |
Hash mask = sum of allocated segment sizes - 1. More... | |
segments_table_t | my_table |
Segment pointers table. Also prevents false sharing between my_mask and my_size. More... | |
atomic< size_type > | my_size |
Size of container in stored items. More... | |
bucket | my_embedded_segment [embedded_buckets] |
Zero segment. More... | |
Static Public Attributes | |
static size_type const | embedded_block = 1 |
Count of segments in the first block. More... | |
static size_type const | embedded_buckets = 1<<embedded_block |
Count of segments in the first block. More... | |
static size_type const | first_block = 8 |
Count of segments in the first block. More... | |
static size_type const | pointers_per_table = sizeof(segment_index_t) * 8 |
Size of a pointer / table size. More... | |
base class of concurrent_hash_map
Definition at line 82 of file concurrent_hash_map.h.
typedef size_t tbb::interface5::internal::hash_map_base::hashcode_t |
Type of a hash code.
Definition at line 87 of file concurrent_hash_map.h.
Node base type.
Definition at line 91 of file concurrent_hash_map.h.
typedef size_t tbb::interface5::internal::hash_map_base::segment_index_t |
Segment index type.
Definition at line 89 of file concurrent_hash_map.h.
Segment pointer.
Definition at line 110 of file concurrent_hash_map.h.
typedef segment_ptr_t tbb::interface5::internal::hash_map_base::segments_table_t[pointers_per_table] |
Segment pointers table type.
Definition at line 112 of file concurrent_hash_map.h.
typedef size_t tbb::interface5::internal::hash_map_base::size_type |
Size type.
Definition at line 85 of file concurrent_hash_map.h.
|
inline |
Constructor.
Definition at line 127 of file concurrent_hash_map.h.
|
inlinestatic |
Add node.
Definition at line 173 of file concurrent_hash_map.h.
References __TBB_ASSERT, tbb::interface5::internal::hash_map_node_base::next, tbb::interface5::internal::hash_map_base::bucket::node_list, and tbb::interface5::internal::rehash_req.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::rehash_bucket().
|
inline |
Check for mask race.
Definition at line 254 of file concurrent_hash_map.h.
References h, and tbb::internal::itt_load_word_with_acquire().
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_fast_find().
|
inline |
Process mask race, check for rehashing collision.
Definition at line 263 of file concurrent_hash_map.h.
References __TBB_ASSERT, h, tbb::internal::itt_load_word_with_acquire(), and tbb::interface5::internal::rehash_req.
|
inline |
Definition at line 218 of file concurrent_hash_map.h.
References s.
|
inline |
Enable segment.
Definition at line 190 of file concurrent_hash_map.h.
References __TBB_ASSERT, tbb::internal::itt_hide_store_word(), tbb::internal::itt_store_word_with_release(), and tbb::interface5::internal::hash_map_base::enable_segment_failsafe::my_segment_ptr.
|
inline |
Get bucket by (masked) hashcode.
Definition at line 234 of file concurrent_hash_map.h.
References __TBB_ASSERT, h, and s.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::bucket_accessor::acquire(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_fast_find().
|
inlinestatic |
Initialize buckets.
Definition at line 164 of file concurrent_hash_map.h.
References tbb::interface5::internal::hash_map_base::bucket::mutex, tbb::interface5::internal::hash_map_base::bucket::node_list, and tbb::interface5::internal::rehash_req.
|
inline |
Insert a node and check for load factor.
Definition at line 285 of file concurrent_hash_map.h.
References __TBB_ASSERT, __TBB_Log2(), tbb::internal::as_atomic(), tbb::internal::itt_hide_load_word(), and mask.
|
inline |
Definition at line 320 of file concurrent_hash_map.h.
References tbb::interface5::internal::hash_map_base::bucket::node_list.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::concurrent_hash_map(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_move_assign().
|
inline |
Swap hash_map_bases.
Definition at line 309 of file concurrent_hash_map.h.
References my_embedded_segment, my_mask, my_size, my_table, tbb::interface5::internal::hash_map_base::bucket::node_list, and tbb::swap().
|
inlinestatic |
Definition at line 159 of file concurrent_hash_map.h.
Referenced by tbb::interface5::internal::hash_map_iterator< Container, Value >::advance_to_next_bucket(), tbb::interface5::internal::hash_map_iterator< Container, Value >::hash_map_iterator(), tbb::interface5::internal::hash_map_iterator< Container, Value >::operator *(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::rehash_bucket(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::search_bucket().
|
inline |
Definition at line 243 of file concurrent_hash_map.h.
References tbb::interface5::internal::empty_rehashed, h, tbb::interface5::internal::rehash_req, and s.
|
inline |
Prepare enough segments for number of buckets.
Definition at line 302 of file concurrent_hash_map.h.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::concurrent_hash_map().
|
inlinestatic |
Definition at line 149 of file concurrent_hash_map.h.
|
inlinestatic |
Definition at line 144 of file concurrent_hash_map.h.
References __TBB_Log2().
|
inlinestatic |
Definition at line 154 of file concurrent_hash_map.h.
|
static |
Count of segments in the first block.
Definition at line 102 of file concurrent_hash_map.h.
|
static |
Count of segments in the first block.
Definition at line 104 of file concurrent_hash_map.h.
|
static |
Count of segments in the first block.
Definition at line 106 of file concurrent_hash_map.h.
bucket tbb::interface5::internal::hash_map_base::my_embedded_segment[embedded_buckets] |
Zero segment.
Definition at line 120 of file concurrent_hash_map.h.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::begin(), and internal_swap().
atomic<hashcode_t> tbb::interface5::internal::hash_map_base::my_mask |
Hash mask = sum of allocated segment sizes - 1.
Definition at line 114 of file concurrent_hash_map.h.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::bucket_count(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_fast_find(), and internal_swap().
atomic<size_type> tbb::interface5::internal::hash_map_base::my_size |
Size of container in stored items.
Definition at line 118 of file concurrent_hash_map.h.
Referenced by tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::empty(), tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::internal_copy(), internal_swap(), and tbb::interface5::concurrent_hash_map< Key, T, HashCompare, Allocator >::size().
segments_table_t tbb::interface5::internal::hash_map_base::my_table |
Segment pointers table. Also prevents false sharing between my_mask and my_size.
Definition at line 116 of file concurrent_hash_map.h.
Referenced by internal_swap().
|
static |
Size of a pointer / table size.
Definition at line 108 of file concurrent_hash_map.h.