Skip to content
Advertisement

Tag: concurrenthashmap

Segment class in ConcurrentHashMap usage

Looking into implementation of ConcurrentHashMap, I see that when trying to manipulate it(put/remove), value is found and this value is then used as lock for synchronized code which performs actual manipulation. This way only that bucket is locked where value actually exists. I also see a class Segment declared and in many resources available online its mentioned that this is

Advertisement