3 ms·
What’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).
by bee_rider 2y ago
What’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.