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

(coll) Thread-safety and Performance improvements to PriorityQueue

XMLWordPrintable

    • b78
    • generic
    • generic
    • Verified

      The Collection constructors taking a Collection were not thread-safe.
      Vector and ArrayList were fixed by

      6355660: (coll) Vector(Collection) constructor is not thread safe
      6347106: (coll) Make ArrayList(Collection) more threadsafe

      but PriorityQueue (and indirectly PriorityBlockingQueue) remain.

      The fix is more involved because providing thread-safety without loss of
      performance requires switching from 1-based to 0-based arrays internally.
      This should be done anyways. There is no reason to waste the initial
      element of the internal backing array.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: