4 ms·
Concurrent reads are also an issue if you hold an exclusive lock.
by menaerus 2y ago
Concurrent 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.