We have come across a strange issue with Concurren开发者_开发百科tHashMap, where two threads appears to be calling put(), and then waiting forever inside the method Unsafe.park(). From the outside, it
is final Map<Integer,Map<String,Integer>> status = new ConcurrentHashMap<Integer, Map<String,Integer>>();
What is the use of ConcurrentHashMap in Java? What ar开发者_如何转开发e its benefits? How does it work?
I read ConcurrentHashMap works better in multi threading than Hashtable due to having locks at bucket level rather than map wide lock. It 开发者_StackOverflow中文版is at max 32 locks possible per map.
Is ConcurrentHashMap.get() guaranteed to see a previous ConcurrentHashMap.put() by different thread?My expectation is that is is, and reading the JavaDocs seems to indicate so, but I am 99% convinced
I am wondering about the parameters for constructing a ConcurrentHashMap: initialCapacity is 16 by default (understood).