What is the difference between a Collections.synchronizedMap() and a wrapper around a HashMap with all the methods synchronized. I dont see any difference becuase Collections.synchronizedMap() internally maintains the same lock for ...
I have a singleton class, that has a map which can be accessed by multiple threads at the same time. Could somebody please check the code below and tell me if ...
Hi, If we are creating a Map like Map m = Collections.synchronizedMap(new HashMap()); whether m should be synchronized if there is possiblity of two or more threads can update the map. In the API they have synchronized m value with the below lines eventhough they created that from synchronizedMap synchronized(m) { // Synchronizing on m, not s! Iterator i = s.iterator(); ...