4 ms·
First time seeing dashmap, but a cursory inspection shows it works via sharded locks: pub struct DashMap<K, V, S = RandomState> { shift: usize,
by ridiculous_fish 3y ago
First time seeing dashmap, but a cursory inspection shows it works via sharded locks:
pub struct DashMap<K, V, S = RandomState> {
shift: usize,
shards: Box<[RwLock<HashMap<K, V, S>>]>,
hasher: S,
}
so an array of RwLocks.
That's quite different than what .NET offers, which is multiple readers and a single writer with NO locks outside of the allocator/GC.
I'm not shilling for .NET (I've never written a .NET app) but it does have a really cool hash table.