![]() |
ATLAS Offline Software
|
Helper to generate hash probes. More...
#include <ConcurrentHashmapImpl.h>
Public Member Functions | |
| CHMTableIterator (size_t hash, size_t mask, size_t maskBits, size_t probeLimit) | |
| Constructor. More... | |
| size_t | offset () const |
| Offset of the element currently being probed. More... | |
| size_t | nprobes () const |
| Return the number of probes performed so far. More... | |
| bool | next () |
| Move to the next probe. More... | |
Static Public Attributes | |
| static constexpr size_t | ENTRIES_PER_CACHELINE_MASK = ENTRIES_PER_CACHELINE-1 |
| Mask for the within-cacheline part of indices. More... | |
Private Attributes | |
| const size_t | m_mask |
| Mask for the table; i.e., capacity-1, but with the low bits corresponding to ENTRIES_PER_CACHELINE also masked off. More... | |
| const size_t | m_boffs |
| Offset of the first entry we probe within its cacheline. More... | |
| const size_t | m_stride |
| Base increment between probes. More... | |
| const size_t | m_probeLimit |
| Maximum number of probes to try. More... | |
| size_t | m_bucket |
| Index of the start of the cacheline currently being probed. More... | |
| size_t | m_nprobes |
| Number of probes tried so far. More... | |
Helper to generate hash probes.
To search for an entry with hash code hash in the table pointed at by entries:
The template argument is the number of table entries per cache line. We try to be cache friendly by first searching all entries in a cache line, then moving to another line.
Definition at line 84 of file ConcurrentHashmapImpl.h.
| CxxUtils::detail::CHMTableIterator< ENTRIES_PER_CACHELINE >::CHMTableIterator | ( | size_t | hash, |
| size_t | mask, | ||
| size_t | maskBits, | ||
| size_t | probeLimit | ||
| ) |
Constructor.
| hash | The hash of the entry we're looking for. |
| mask | Table mask; i.e., the table capacity - 1. |
| maskBits | Number of 1 bits in mask. |
| probeLimit | Maximum number of probes to try before failing. |
| bool CxxUtils::detail::CHMTableIterator< ENTRIES_PER_CACHELINE >::next | ( | ) |
Move to the next probe.
Returns true if we should continue, or false if we've hit the maximum number of probes.
| size_t CxxUtils::detail::CHMTableIterator< ENTRIES_PER_CACHELINE >::nprobes | ( | ) | const |
Return the number of probes performed so far.
| size_t CxxUtils::detail::CHMTableIterator< ENTRIES_PER_CACHELINE >::offset | ( | ) | const |
Offset of the element currently being probed.
|
staticconstexpr |
Mask for the within-cacheline part of indices.
Definition at line 87 of file ConcurrentHashmapImpl.h.
|
private |
Offset of the first entry we probe within its cacheline.
Definition at line 124 of file ConcurrentHashmapImpl.h.
|
private |
Index of the start of the cacheline currently being probed.
Definition at line 130 of file ConcurrentHashmapImpl.h.
|
private |
Mask for the table; i.e., capacity-1, but with the low bits corresponding to ENTRIES_PER_CACHELINE also masked off.
Definition at line 122 of file ConcurrentHashmapImpl.h.
|
private |
Number of probes tried so far.
Definition at line 132 of file ConcurrentHashmapImpl.h.
|
private |
Maximum number of probes to try.
Definition at line 128 of file ConcurrentHashmapImpl.h.
|
private |
Base increment between probes.
Definition at line 126 of file ConcurrentHashmapImpl.h.
1.8.18