-
Bug
-
Resolution: Fixed
-
P4
-
11, 13
-
b20
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8235319 | 11.0.7-oracle | Ivan Gerasimov | P4 | Resolved | Fixed | b01 |
JDK-8226667 | 11.0.5 | Doug Lea | P4 | Resolved | Fixed | b01 |
A user noticed that CopyOnWriteArrayList.set no longer does a volatile write when the new element is already present in its slot.
https://concurrency.markmail.org/thread/sdx7ehxrjqzrqmiy
Although such usage is questionable, and one can argue there is no guarantee of happens-before when the element is not in need of an update, and in practice no one will ever notice since the JVM is unlikely to optimize away the synchronized block in the method's implementation, nevertheless we should revert to an unconditional volatile write as seen in jdk8.
https://concurrency.markmail.org/thread/sdx7ehxrjqzrqmiy
Although such usage is questionable, and one can argue there is no guarantee of happens-before when the element is not in need of an update, and in practice no one will ever notice since the JVM is unlikely to optimize away the synchronized block in the method's implementation, nevertheless we should revert to an unconditional volatile write as seen in jdk8.
- backported by
-
JDK-8226667 CopyOnWriteArrayList.set should always have volatile write semantics
- Resolved
-
JDK-8235319 CopyOnWriteArrayList.set should always have volatile write semantics
- Resolved
- relates to
-
JDK-8200258 Improve CopyOnWriteArrayList subList code
- Resolved