package picos
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=0f2dcc67ddd127c68f388f2c36a8725a15723e6aeba7d1ddfcf4e016b54a4674
sha512=bee2a99458a451be285e2f13cc3a9deda8eed4e118bcdfc51c256d2da5bae92eec3386c318fe42dcf451421543b519dc064967158b3f417c9b7b44ce97c5fb75
doc/picos.htbl/Picos_htbl/index.html
Module Picos_htbl
Source
Lock-free hash table.
🏎️ Single key reads with this hash table are actually wait-free rather than just lock-free. Internal resizing automatically uses all the threads that are trying to write to the hash table.
Represents a lock-free hash table mapping keys of type 'k
to values of type 'v
.
First-class module type abbreviation.
create ~hashed_type:(module Key) ()
creates a new empty lock-free hash table.
The optional hashed_type
argument can be used to specify the equal
and hash
operations on keys. Slow polymorphic equality (=)
and slow polymorphic hash
are used by default.
find_exn htbl key
returns the current binding of key
in the hash table htbl
or raises Not_found
if no such binding exists.
mem htbl key
determines whether the hash table htbl
has a binding for the key
.
try_add htbl key value
tries to add a new binding of key
to value
to the hash table htbl
. Returns true
on success and false
in case the hash table already contained a binding for key
.
try_remove htbl key
tries to remove a binding of key
from the hash table htbl
. Returns true
on success and false
in case the hash table did not contain a binding for key
.