Improved bulk operation disclaimers for concurrent collections

Chris Hegarty chris.hegarty at oracle.com
Fri Apr 22 12:24:07 UTC 2011


Doug,

I'll pull in these changes and try to get them into b142 ( before ramp 
down phase 2 ).

Thanks,
-Chris.

On 04/22/11 12:53 PM, Doug Lea wrote:
>
> Here's another set of very minor javadoc updates: The lists of
> non-atomic "bulk" operations were incomplete in some concurrent
> collections and missing in others, as was noted in a recent ASPLOS paper
> "Specifying and Checking Semantic Atomicity for Multithreaded Programs"
> by Jacob Burnim, George Necula, Koushik Sen. (See
> http://www.cs.berkeley.edu/~jburnim/pubs/BurnimNeculaSen-ASPLOS11.pdf).
> A sample update is below. I updated jsr166 versions. I'll work
> with the usual folks to create a CR and integrate. (Thanks very
> much to Chris Hegarty in particular for being so helpful with these
> integrations!)
>
>
> diff -r1.73 ConcurrentLinkedQueue.java
> 46c46,53
> < * of elements requires a traversal of the elements.
> ---
>  > * of elements requires a traversal of the elements, and so may report
>  > * inaccurate results if this collection is modified during traversal.
>  > * Additionally, the bulk operations <tt>addAll</tt>,
>  > * <tt>removeAll</tt>, <tt>retainAll</tt>, <tt>containsAll</tt>,
>  > * <tt>equals</tt>, and <tt>toArray</tt> are <em>not</em> guaranteed
>  > * to be performed atomically. For example, an iterator operating
>  > * concurrently with an <tt>addAll</tt> operation might view only some
>  > * of the added elements.



More information about the core-libs-dev mailing list