Quantcast
Channel: Using ConcurrentHashMap - Stack Overflow
Browsing all 6 articles
Browse latest View live

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 Article



Answer 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 Article

Answer 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 Article

Answer 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 Article

Answer 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 Article


Using 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
Browsing all 6 articles
Browse latest View live




Latest Images