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
Post a Comment