proxygen
|
Public Member Functions | |
~Slot () | |
BucketState | state () const |
void | stateUpdate (BucketState before, BucketState after) |
value_type & | keyValue () |
const value_type & | keyValue () const |
Public Attributes | |
Atom< IndexType > | headAndState_ |
IndexType | next_ |
The next bucket in the chain. More... | |
std::aligned_storage< sizeof(value_type), alignof(value_type)>::type | raw_ |
Key and Value. More... | |
Lock-free insertion is easiest by prepending to collision chains. A large chaining hash table takes two cache misses instead of one, however. Our solution is to colocate the bucket storage and the head storage, so that even though we are traversing chains we are likely to stay within the same cache line. Just make sure to traverse head before looking at any keys. This strategy gives us 32 bit pointers and fast iteration.
Definition at line 354 of file AtomicUnorderedMap.h.
|
inline |
Definition at line 368 of file AtomicUnorderedMap.h.
References s.
|
inline |
Definition at line 386 of file AtomicUnorderedMap.h.
|
inline |
Definition at line 391 of file AtomicUnorderedMap.h.
|
inline |
Definition at line 377 of file AtomicUnorderedMap.h.
|
inline |
Definition at line 381 of file AtomicUnorderedMap.h.
Atom<IndexType> folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::Slot::headAndState_ |
The bottom two bits are the BucketState, the rest is the index of the first bucket for the chain whose keys map to this slot. When things are going well the head usually links to this slot, but that doesn't always have to happen.
Definition at line 359 of file AtomicUnorderedMap.h.
Referenced by folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::allocateNear(), and folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::find().
IndexType folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::Slot::next_ |
The next bucket in the chain.
Definition at line 362 of file AtomicUnorderedMap.h.
Referenced by folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::find().
std::aligned_storage<sizeof(value_type), alignof(value_type)>::type folly::AtomicUnorderedInsertMap< Key, Value, Hash, KeyEqual, SkipKeyValueDeletion, Atom, IndexType, Allocator >::Slot::raw_ |
Key and Value.
Definition at line 366 of file AtomicUnorderedMap.h.