Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7038885

(doc) Improved bulk operation disclaimers for concurrent collections

XMLWordPrintable

    • b142
    • generic
    • generic
    • Verified

      see discussion on core-libs-dev:
        http://mail.openjdk.java.net/pipermail/core-libs-dev/2011-April/006688.html

      From Doug:

      Here's another set of very minor javadoc updates: The lists of
      non-atomic "bulk" operations were incomplete in some concurrent
      collections and missing in others, as was noted in a recent ASPLOS paper
      "Specifying and Checking Semantic Atomicity for Multithreaded Programs"
      by Jacob Burnim, George Necula, Koushik Sen. (See
      http://www.cs.berkeley.edu/~jburnim/pubs/BurnimNeculaSen-ASPLOS11.pdf).
      A sample update is below. I updated jsr166 versions. I'll work
      with the usual folks to create a CR and integrate. (Thanks very
      much to Chris Hegarty in particular for being so helpful with these
      integrations!)


      diff -r1.73 ConcurrentLinkedQueue.java
      46c46,53
      < * of elements requires a traversal of the elements.
      ---
       > * of elements requires a traversal of the elements, and so may report
       > * inaccurate results if this collection is modified during traversal.
       > * Additionally, the bulk operations <tt>addAll</tt>,
       > * <tt>removeAll</tt>, <tt>retainAll</tt>, <tt>containsAll</tt>,
       > * <tt>equals</tt>, and <tt>toArray</tt> are <em>not</em> guaranteed
       > * to be performed atomically. For example, an iterator operating
       > * concurrently with an <tt>addAll</tt> operation might view only some
       > * of the added elements.

            chegar Chris Hegarty
            chegar Chris Hegarty
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: