Hi Hamlin, On 23/08/2016 6:55 PM, Hamlin Li wrote:
Below doc is not correct, because for ConcurrentLinkedDeque and ConcurrentLinkedQueue, addAll is a atomic operation.
No it is not! There is no bug here. Are you perhaps confusing thread-safe with atomic?
David -----
"Additionally, the bulk operations addAll, removeAll, retainAll, containsAll, equals, and toArray are not guaranteed to be performed atomically. For example, an iterator operating concurrently with an addAll operation might view only some of the added elements." It should be modified as some thing like below: "Additionally, the bulk operations removeAll, retainAll, containsAll, equals, and toArray are not guaranteed to be performed atomically." bug: https://bugs.openjdk.java.net/browse/JDK-8164623 webrev: http://cr.openjdk.java.net/~mli/8164623/webrev.00/ Thank you -Hamlin