4 ms·
No, concurrent writes are the problem. That's why it spreads writability into buckets, so that they are mostly independent.
by rurban 2y ago
No, concurrent writes are the problem. That's why it spreads writability into buckets, so that they are mostly independent.
- menaerus 2y agoConcurrent reads are also an issue if you hold an exclusive lock.
- bee_rider 2y agoWhat’s the issue here? (Why would a lock be needed for reading). Or is it a read in parallel with a write (seems very tricky! But people are very clever).
- menaerus 2y agoBecause under general case you cannot read from concurrent hashmap unless you make sure that write is not taking place. And to do that we need locks, either exclusive (mutex) or more fine grained locks such as rw-lock.
- bee_rider 2y agoThat’s a different problem. I was responding to a comment asking about benchmarks for concurrent reads. In general we have CPU systems with hundreds of cores nowadays, so I think it’s hard to say something is “the problem” as far as parallelism goes. For example, I have a problem where I got a 100x speed up in the “computationally difficult” part of the problem… suddenly all the stuff that looked too cheap to bother with became more noticeable!
- menaerus 2y agoYes, I mean if you have a hashmap for read-only workload where insertion is not going to take place after initial build-up then there isn't much to do.