Open lovasoa opened 2 years ago
I can think of a few simple ways to fix this, depending on your needs:
What I am proposing is to use a concurrent hashmap, so that none of these workarounds has to be implemented.
There are multiple off the shelf concurrent hashmaps available in rust. Here is a comparison: https://github.com/xacrimon/conc-map-bench
dashmap is a popular choice: https://github.com/xacrimon/dashmap
Looking at the code base, it looks like all the datastructures are full of
Arc<std::sync::RwLock<T>>
. Notably, the address space is aArc<std::sync::RwLock<HashMap<NodeId, Node>>>
. Would you be open to a big pull request that would replace that with a concurrent hashmap, to avoid blocking the entire server on every variable write ?This would probably be quite a large PR, so I would like to discuss it here before starting the work. If you don't have the time to review a large pr, that's ok, I can fork this repo and publish it under a different name.