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

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -