• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

difference between NavigableMap and ConcurrentNavigableMap

 
Ranch Hand
Posts: 305
Tomcat Server Notepad Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Master Rancher
Posts: 4806
72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic