2 ms·
Did you consider just making an array of HashMap, say 512 of them, and locking only one of them based on your key's hash? Or, more generally, minimizing the od
by nitwit005 3y ago
Did you consider just making an array of HashMap, say 512 of them, and locking only one of them based on your key's hash?
Or, more generally, minimizing the odds of waiting on a lock, without resorting to a complex lock free scheme?
- usefulcat 3y ago> Did you consider just making an array of HashMap, say 512 of them, and locking only one of them based on your key's hash? A disadvantage of that approach is that even without any lock contention you would still have two writes to memory for every lock acquisition.