riot
riot copied to clipboard
Rewrite Hashmap to play nicely with the scheduler
At the moment we are exposing our internal "Dashmap" as a Hashmap that should be prefered in userland Riot programs for concurrent access.
Sadly, this Hashmap is far from ideal as it is lock-based. We should design a version of this interface that plays along nicely with concurrent and parallel access, and that doesn't rely on locks directly, but rather uses Riot-friendly mutexes.
It'll be useful to have some of #45 in place to do this.
Implementation Notes
Something I had in mind was to mimic what Dashmap from Rust does, where the Hashmap has individual read-write locks for every single entry, which allows concurrent and parallel read/write access to separate entries.
This could be implemented on top of the Hashtbl.t
(like the current dashmap.ml
does), and just try to get a lock on a value at the very moment the value will be used.
I'd love to take this on!
Hi @FayCarsons! That sounds great :D assigning it to you. Thanks for reaching out! ✨