Interview Question
Country: United States
The implementation of concurrency in the hashmap adds overhead to its operations, so in cases where there is little contention for the map (and hence little time spent waiting on any locks on the map to be released) you may be better off with a regular hashmap since any uncontested lock checking on that map will be very fast.
Also ConcurrentHashmaps cannot contain null keys or values, which may be problematic in some applications.
The concurrentHashMap iterators are not fail-fast in the sense that they do not throw a ConcurrentModificationException. They also do not guarantee that once the iterator is created it will list/show all elements that are added after its creation. The iterators do however guarantee that any updates or removal of items will be reflected correctly in their behaviour. They also guarantee that no element will be returned more than once while traversal. which is a big draw back
- manish April 11, 2013hence in nut shell The no-synchronized Iterator is a major drawback i know for ConcurrentHashMap .