michaelsproul / rust_sequence_trie

Ergonomic trie data structure
https://docs.rs/sequence_trie/
Other
26 stars 21 forks source link

Concurrency Readiness #42

Open candronikos opened 5 years ago

candronikos commented 5 years ago

Hi, I wish to use this structure to contain the topics for a PubSub server. I'm planning to add a CHashMap feature in my fork but wanted run it by you first.

Do you see any issues with dropping it in to your existing implementation? My application will use this as an acitx actor.

michaelsproul commented 5 years ago

Did you mean to post this issue on rust_sequence_trie? It would make more sense in that context, as the sequence trie uses a HashMap or BTreeMap as its backing, whereas my radix trie uses neither.

Assuming that's the case, I think there would be nothing to preclude using a CHashMap as the backing map for a sequence trie, but changing the type signature of insert to take a shared reference might require a bit more work. Specifically, there are fields of the SequenceTrie struct that aren't part of the map which you would need to do concurrency control for (using a mutex or something similar).