Skip to content
#

hashmap

Here are 385 public repositories matching this topic...

kazimuth
kazimuth commented Apr 2, 2020

This code:

let map = DashMap::<i32, i32>::new();
map.insert(1, 2);
let a = map.get_mut(&1);
let b = map.get(&1);

will deadlock. The shard containing 1 gets write-locked, nothing else can access it. This is reasonable behavior but I think it should be documented.

Perhaps more surprising is that this code:

let map = DashMap::<i32, i32>::new();

for i in 0..100

Improve this page

Add a description, image, and links to the hashmap topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the hashmap topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.