aspose file tools
The moose likes Threads and Synchronization and the fly likes difference between NavigableMap and ConcurrentNavigableMap Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "difference between NavigableMap and ConcurrentNavigableMap" Watch "difference between NavigableMap and ConcurrentNavigableMap" New topic
Author

difference between NavigableMap and ConcurrentNavigableMap

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 225

There are some additions to the Java Collection Framework, I tried to find out but could not drill down what is actually difference between "NavigableMap" and "ConcurrentNavigableMap".

Is it ConcurrentNavigableMap can be modified by different threads only?


OCAJP
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 2770
    
    2
A ConcurrentNavigableMap has all the methods of a NavigableMap, plus all the methods of a ConcurrentMap. Other NavigableMaps do not have ConcurrentMap methods.

Is it ConcurrentNavigableMap can be modified by different threads only?

No - if for some reason you want to modify a ConcurrentNavigableMap using only one thread, that's fine, it will work normally. The point is that if you do have multiple threads accessing a Map, you need a ConcurrentMap.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: difference between NavigableMap and ConcurrentNavigableMap
 
Similar Threads
Quick Question HttpSessionBinding vs HttpSessionAttribute Listeners
what are the chapters i have to ignore
SCJP 6
Passing SCJP 6.0 with SCJP 5.0 preparation???
JATO Vs JDOM