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.
http://javarevisited.blogspot.ca/2011/04/difference-between-concurrenthashmap.html#%2EVqM9k3oftOg%2Elinkedin
I have another article describing get/put method of ConcurrentHashMap is not threadsafe.
http://detailfocused.blogspot.ca/2015/10/getput-method-of-concurrenthashmap-is.html
No comments:
Post a Comment