dashmap
dashmap copied to clipboard
ensure shard count == # keys
much like a sharded db, i have keys that are totally independent of each other so it would be nice to have a way to just make sure that writes to a single key do not block reads or writes to any other key. as far as i understand currently the shard count is calculated based off # of cores. and writes to a key in one shard block all ops to the other keys in that shard?
is this or will this be possible?
Is this method sufficient?
https://docs.rs/dashmap/latest/dashmap/struct.DashMap.html#method.with_shard_amount
Given that #shards needs to be a power of 2 according to the docs, I'm doubtful that having exactly one shard per key is possible but, having shards == capacity may be.
Otherwise would a try_reshard
be better for once you exceed capacity?