4 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? A disadvantage of that approach is
by 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.