“Concurrenthashmap w Javie” Kod odpowiedzi

Concurrenthashmap w Javie

Maps are naturally one of the most widely style of Java collection.

And, importantly, HashMap is not a thread-safe implementation, while Hashtable does provide thread-safety by synchronizing operations.

Even though Hashtable is thread safe, it is not very efficient. Another fully synchronized Map, Collections.synchronizedMap, does not exhibit great efficiency either. If we want thread-safety with high throughput under high concurrency, these implementations aren't the way to go.

To solve the problem, the Java Collections Framework introduced ConcurrentMap in Java 1.5.

Delta Sierra

Java Utwórz Concurrenthashmap

// ConcurrentHashMap with capacity 8 and load factor 0.6
ConcurrentHashMap<Key, Value> numbers = new ConcurrentHashMap<>(8, 0.6f);
SAMER SAEID

Odpowiedzi podobne do “Concurrenthashmap w Javie”

Pytania podobne do “Concurrenthashmap w Javie”

Więcej pokrewnych odpowiedzi na “Concurrenthashmap w Javie” w Java

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu