First in 1.0, we have legacy collection like Vector and HashTable.
They are all fully thread safe via locks.
– Stack (subclass of Vector)
Then comes the collection framework consisting of ArrayList, HashMap, etc. They are not thread safe just doing collection.
All collection classes support Iterator so that users can iterate over all elements in the collection.
– Iterator (vs Enumeration)
– ArrayList (vs Vector)
– Map (vs Dictionary)
– HashMap (vs Hashtable)
And finally we get the concurrent classes like CopyOnWriteArrayList, ConcurrentHashMap for fast thread safe access without the use of locks, and List interface and collection.
– CopyOnWriteArrayList (vs ArrayList)
– ConcurrentHashMap (vs HashMap)
– BlockingQueue (interface)
Misuse of concurrenthaspmap, need to initialize it with parameter to get good performance.
3rd param concurrencyLevel could cause performance issue if not specified.