Answer by hi.nitish for Using ConcurrentHashMap
There is one more important feature to note for concurrenthmp other than the concurrency feature it provides, which is fail safe iterator. Use CHMP just because they want to edit the entryset for...
View ArticleAnswer by Marko Topolnik for Using ConcurrentHashMap
ConcurrentHashMap is suited only to the cases where you don't need any more atomicity than provided out-of-the-box. If for example you need to get a value, do something with it, and then set a new...
View ArticleAnswer by zeller for Using ConcurrentHashMap
No, you don't need, but if you need to depend on internal synchronization, you should use Collections.synchronizedMap instead. From the javadoc of ConcurrentHashMap:This class is fully interoperable...
View ArticleAnswer by assylias for Using ConcurrentHashMap
Short answer: no you don't need to use synchronized(map).Long answer:all the operations provided by ConcurrentHashMap are thread safe and you can call them without worrying about lockinghowever, if you...
View ArticleAnswer by Peter Lawrey for Using ConcurrentHashMap
It handles the locks itself, and in fact you have no access to them (there is no other option)You can use synchronized in special cases for writes, but it is very rare that you should need to do this....
View ArticleUsing ConcurrentHashMap
I'm new to threading in Java and I need to access data structure from few active threads. I've heard that java.util.concurrent.ConcurrentHashMap is threading-friendly. Do I need to use...
View Article
More Pages to Explore .....