Duplicate :
|
|
Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
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.
|