8000 Rewrite Hashmap to play nicely with the scheduler · Issue #46 · riot-ml/riot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content 8000
Rewrite Hashmap to play nicely with the scheduler #46
Open
@leostera

Description

@leostera

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0