Expand description
HashMap - A concurrently readable HashMap
This is a specialisation of the BptreeMap
, allowing a concurrently readable
HashMap. Unlike a traditional hashmap it does not have O(1)
lookup, as it
internally uses a tree-like structure to store a series of buckets. However
if you do not need key-ordering, due to the storage of the hashes as u64
the operations in the tree to seek the bucket is much faster than the use of
the same key in the BptreeMap
.
For more details. see the BptreeMap
This structure is very different to the im
crate. The im
crate is
sync + send over individual operations. This means that multiple writes can
be interleaved atomicly and safely, and the readers always see the latest
data. While this is potentially useful to a set of problems, transactional
structures are suited to problems where readers have to maintain consistent
data views for a duration of time, cpu cache friendly behaviours and
database like transaction properties (ACID).
Modules
HashMap - A async locked concurrently readable HashMap
Structs
A concurrently readable map based on a modified B+Tree structured with fast parallel hashed key lookup.
A point-in-time snapshot of the tree from within a read OR write. This is useful for building other transactional types ontop of this structure, as you need a way to downcast both HashMapReadTxn or HashMapWriteTxn to a singular reader type for a number of get_inner() style patterns.
An active read transaction over a HashMap
. The data in this tree
is guaranteed to not change and will remain consistent for the life
of this transaction.
An active write transaction for a HashMap
. The data in this tree
may be modified exclusively through this transaction without affecting
readers. The write may be rolledback/aborted by dropping this guard
without calling commit()
. Once commit()
is called, readers will be
able to access and percieve changes in new transactions.