Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6792285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:57:01+00:00 2026-05-26T17:57:01+00:00

In the JavaDoc for ConcurrentNavigableMap , I’m a bit confused as to the following:

  • 0

In the JavaDoc for ConcurrentNavigableMap, I’m a bit confused as to the following:

The view’s iterator is a “weakly consistent” iterator that will never
throw ConcurrentModificationException, and guarantees to traverse
elements as they existed upon construction of the iterator, and may
(but is not guaranteed to) reflect any modifications subsequent to
construction.

The wording seems the same in implementations of the interface like ConcurrentSkipListMap.

What does this mean, it seems a contradiction – either it could guarantee to traverse elements as they existed upon construction, OR it might reflect modifications subsequent to construction??

UPDATE: I’d basically like to know if creating an iterator on ConcurrentNavigableMaps like ConcurrentSkipListMap, creates a “snapshot” view of the map.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:57:02+00:00Added an answer on May 26, 2026 at 5:57 pm

    To answer my own question, there is a discussion of the strength of the consistency guarantee provided by iterators on the concurrency-interest mailing list here.

    The author of ConcurrentHashMap and ConcurrentSkipListMap, Doug Lea, appears to agree that the guarantee is not much of a guarantee at all, and that in the case of ConcurrentHashMap, the iterator can report the map to be in a state that it was never
    actually in.

    For those curious, the source of ConcurrentSkipListMap, specifically its internal Iter (iterator) class is here.

    The iterator in ConcurrentSkipListMap iterates the regular nodes within the skip list, and those nodes are linked using volatile references. It might be the case that this somewhat confusing JavaDoc statement is actually [simply] referring to a happens-before guarantee. i.e. that changes made by other threads prior to creating the iterator, will be simply be visible to the thread driving the iteration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

MIdlet's class javadoc states that MIdlet.destroyApp() will be called if MIdlet.startApp() throws a RuntimeException
The javadoc for the Document class has the following note under getElementById . Note:
I see from the javadoc that the @SuppressWarnings annotation applies to TYPE,FIELD,METHOD,PARAMETER,CONSTRUCTOR,LOCAL_VARIABLE targets. Why
This FileInputStream.available() javadoc says: Returns an estimate of the number of remaining bytes that
The javadoc for org.joda.time.format.ISODateTimeFormat.dateTime() is: Returns a formatter that combines a full date and
The javadoc says: Please note that this class is designed to provide convenience rather
From the JavaDoc : returns: The String that is the result of evaluating the
The Javadoc for EventListenerLists says that they offer a degree of MT safety (when
The netty javadoc explains that setReadable suspends/resumes the read operation of the I/O thread.
My Eclipse javadoc view has a black background which makes it look terrible and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.