Can someone elaborate this line briefly?
“In Summary ConcurrentHashMap only locked certain portion of Map while Hashtable lock full map while doing iteration”
Can someone elaborate this line briefly?
“In Summary ConcurrentHashMap only locked certain portion of Map while Hashtable lock full map while doing iteration”
The reason is scalability. ConcurrentHashMap divides the map in parts and locks them individually. So multiple threads can access those different parts simultaneously. But a given segment is synchronized.
In essence it's about partial locking of the collection versus full locking.
Read this for more.