Difference in ConcurrentHashMap and synchronized Map

Tutorials Shared by the Internet Community

Advertisements


Synopsis

JDK 1.5 introduces some good concurrent collections which is highly efficient for high volume

Statistics

  • Total Hits - 27199

  • Total Votes - 98 votes

  • Vote Up - 42 votes

  • Vote Down - 56 votes

  • Domain - javarevisited.blogspot.com

  • Category - JAVA/Collections

  • Submitted By - Javin Paul

  • Submitted on - 2011-07-03 05:58:03

Description

The synchronized collections classes, Hashtable and Vector, and the synchronized wrapper classes, Collections.synchronizedMap and Collections.synchronizedList, provide a basic conditionally thread-safe implementation of Map and List. However, several factors make them unsuitable for use in highly concurrent applications for example their single collection-wide lock is an impediment to scalability and it often becomes necessary to lock a collection for a considerable time during iteration to prevent ConcurrentModificationException ...


Site  |   Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements