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

(coll) Make ArrayList(Collection) more threadsafe

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.1, 5.0, 6
    • Fix Version/s: 6
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b78
    • CPU:
      generic, x86
    • OS:
      generic, linux, windows_xp
    • Verification:
      Verified

      Description

      This covers changes to Vector, ArrayList, and PriorityQueue
      collection constructors that both make them accommodate
      traversals with different numbers of elements than reported
      size(), and as a byproduct makes them fail less often with
      concurrently modified non-concurrent ones.

      It is common for academic papers investigating concurrency bugs in the JDK
      to cite the classic

      Collection c = new Vector();
      // Mutate c in another thread
      Vector v = new Vector(c); // may fail unexpectedly

      Here the concurrency issue is not with "this", but with the
      argument collection, which has unknown concurrency properties,

      Because of this, synchronized Vector and unsynchronized ArrayList have the same issues.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              martin Martin Buchholz
              Reporter:
              martin Martin Buchholz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: