-1

Can someone elaborate this line briefly?

“In Summary ConcurrentHashMap only locked certain portion of Map while Hashtable lock full map while doing iteration”

Jim Garrison
  • 85,615
  • 20
  • 155
  • 190

1 Answers1

0

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.

Sid
  • 4,893
  • 14
  • 55
  • 110