What will be the concurrencyLevel if ConcurrentHashMap size increased?
Suppose initial capacity of ConcurrentHashMap is 16. and default concurrencyLevel will 16. If capacity increased by load factor after some time and now increased capacity is 28. What will be the concurrencyLevel in this case?
Gone through with these links as well Segmentation in ConcurrentHashMap and Modifying values in ConcurrentHashMap but still not clear.
Thanks in advance.
There is no reason to think upon reading the documentation that concurrency level can ever change. It remains what it is set to during object creation. When in doubt, browse the source code:
http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/43cb25339b55/src/share/classes/java/util/concurrent/ConcurrentHashMap.java
it seems that currently all it does is raises the number of bins if initial capacity is less than specified concurrency level.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With