-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b63
-
generic
-
generic
Academic researchers often go looking for concurrency bugs,
and when investigating the Java libraries, the Vector(Collection)
constructor is usually the first one they find. E.g.
http://www.cs.sunysb.edu/~liqiang/atomicity-introduction.htm
http://www.soe.ucsc.edu/~cormac/papers/tldi05.ps
Pretty much any user expects that, since Vector is synchronized
and "thread-safe", then the following is safe:
Collection c = new Vector();
// Mutate c wildly
Vector v = new Vector(c);
Of course, Vector cannot assume that its argument is not being
concurrently mutated. Fortunately, c.toArray() is perfect for
initializing Vector's own internal array.
This is part of the fix for
6347106: (coll) methods taking concurrently modified collection arguments fail sporadically
and when investigating the Java libraries, the Vector(Collection)
constructor is usually the first one they find. E.g.
http://www.cs.sunysb.edu/~liqiang/atomicity-introduction.htm
http://www.soe.ucsc.edu/~cormac/papers/tldi05.ps
Pretty much any user expects that, since Vector is synchronized
and "thread-safe", then the following is safe:
Collection c = new Vector();
// Mutate c wildly
Vector v = new Vector(c);
Of course, Vector cannot assume that its argument is not being
concurrently mutated. Fortunately, c.toArray() is perfect for
initializing Vector's own internal array.
This is part of the fix for
6347106: (coll) methods taking concurrently modified collection arguments fail sporadically
- relates to
-
JDK-6347106 (coll) Make ArrayList(Collection) more threadsafe
-
- Closed
-
-
JDK-6394004 (coll) Thread-safety and Performance improvements to PriorityQueue
-
- Closed
-