Crates.io | mbarc-map |
lib.rs | mbarc-map |
version | 0.9.0 |
source | src |
created_at | 2024-03-10 03:39:40.322085 |
updated_at | 2024-03-19 17:50:16.702713 |
description | Implementation of a Minimally-blocking, Atomic Reference Counted Map |
homepage | |
repository | https://github.com/gentlecolts/mbarc-map |
max_upload_size | |
id | 1168281 |
size | 43,417 |
Minimally-blocking, Atomic Reference Counted Map
The motivation of the map implemented in this crate is to provide a map that is better suited towards concurrent use. This, in particular, attempts to solve two particular problems:
Individually, these aren't huge asks, but achieving both of these properties while satisfying rust ended up being complex enough to be worth wrapping, thus leading to the creation of MbarcMap.
You can kind of think of MbarcMap<T,U>
as a shorthand for: Mutex<HashMap<T,Arc<Mutex<U>>>>
, however there's more to it than that, especially in regards to pointer safety (stored values are never moved), memory layout (data is stored in continuous blocks), and iterators (safe to alter the map while iterating over it)0