Closed Maimonator closed 4 years ago
Hey. The data structure isn't explicitly concurrent, but there shouldn't anything be anything stopping it from being used in a multi-threaded context. The usual ways of synchronising access with a mutex or read-write lock should work. I'm quite fond of the parking_lot
crate, which has fast and easy to use implementations of Mutex
and RwLock
. You could create a trie: RwLock<Trie<K, V>>
, and then use methods like trie.read().get()
and trie.write().get_mut()
, etc.
Does that answer your question?
This was such a great answer with lots of information. Thanks a lot!!!
No worries! Glad I could help :)
Hey! I've been wondering if this library supports multithreading in rust. Thanks! :)