Thursday, February 11, 2016

Difference between ConcurrentHashMap, Hashtable and Synchronized Map in Java

All are thread safe(*). All methods of HashTable are synchronized. It is slow. Synchronized Map is similar. ConcurrentHashMap has better performance because it introduces the concept segmentation, which only locks certain portion of map.

I have another article describing get/put method of ConcurrentHashMap is not threadsafe.

No comments:

Post a Comment