Java ConcurrentMap and ConcurrentHashMap

Опубликовано: 28 Ноябрь 2024
на канале: Jakob Jenkov
5,190
209

The Java ConcurrentMap and its implementation ConcurrentHashMap represents a Java Map that provides better concurrency than the Java Hashtable class.

The Hashtable class only allows 1 thread at a time to call any of its methods.

The ConcurrentHashMap allows multiple threads to call its methods in several cases. First of all, more than one thread are allowed to read from the ConcurrentHashMap at the same time. Second, more than one thread are allowed to write to the ConcurrentHashMap if they do not write to the same keys (and possibly only if the key + value pairs they insert land in different buckets internally).

Java ConcurrentMap + ConcurrentHashMap tutorial - Text:
https://jenkov.com/tutorials/java-uti...

Java Concurrency tutorial - Text:
https://jenkov.com/tutorials/java-con...

Java Concurrency tutorial - video playlist:
   • Java Concurrency and Multithreading  

Java Map tutorial - Text:
https://jenkov.com/tutorials/java-col...

Java Map tutorial - video:
   • Java Map  

Java Lambda Expression tutorial - text:
https://jenkov.com/tutorials/java/lam...

Java Lambda Expression tutorial - video playlist:
   • Java Lambda Expressions