java - In ConcurrentHashMap, why don't use ReentrantReadWriteLock in place of ReentrantLock on segment -


since concurrenthashmap can't 100% secure consistency on write operation (i.e. size()), using reentrantreadwritelock(or it's derived class customizing) instead can improve performance, right?

performance improvement depend upon kind of operation want do. if want read more yes otherwise while thread writing [i.e has taken write lock] , no other thread can take read or write lock performance gain wont there.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -