JDK-6394004 : (coll) Thread-safety and Performance improvements to PriorityQueue
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:collections
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-03-04
  • Updated: 2017-05-16
  • Resolved: 2006-03-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b78Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
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.

Comments
EVALUATION Doug Lea is providing a fix.
04-03-2006