Browsing index pages (3 articles)
↧
ConcurrentHashMap and putAll() method
Normally (ie. not concurrently), putAll() cannot be more efficient than using lot's of calls to put(), even assuming that you exclude the cost of building the other Map that you pass to putAll()....
View ArticleAnswer by cletus for ConcurrentHashMap and putAll() method
The first (mostly) threadsafe Map in Java Collections was the synchronized HashMap using Collections.synchronizedMap(). It worked by only allowing one operation at a time. Java 5 added the...
View ArticleAnswer by Kevin Bourrillion for ConcurrentHashMap and putAll() method
putAll() just delegates to put(). There's no need to build up an intermediate map if you don't have it already. You can see this in the source code, and it doesn't matter what Java implementation...
View Article
Browsing index pages (3 articles)