Quantcast
Channel: Is "ConcurrentHashMap.putAll(...)" atomic? - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Is "ConcurrentHashMap.putAll(...)" atomic?

$
0
0

Is the method ConcurrentHashMap.putAll(Map) supposed to be atomic?

I cannot find it in the documentation and it is not mentioned in the ConcurrentMap interface, so I guess the answer is no. I am asking it to be sure, since it wouldn't make sense if that operation wasn't atomic to be honest.

If it isn't atomic, what would be the best way to support atomic inserts of multiple items? Back to the good old synchronized?


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images