[concurrency-interest] Questions about ArrayDeque

Joshua Bloch josh at bloch.us
Fri Jul 21 18:25:14 EDT 2006


Rémi,

On 7/21/06, Rémi Forax <forax at univ-mlv.fr> wrote:
> To josh, perhaps i am tired, but for me,  allocateElements() always
> allocates
> a power of two size.

Fair enough...

> The other invariant is that head and tail must be
> different
> if the size is not empty, it seems to be the case.
> So i continue to think that this implementation is valid.

No.   Sun decided to make all collection "copy-constructors" robust to
concurrent modification of the argument.  This is wise, in light of
the fact that we now have true concurrent collections that cannot be
globally locked.  So Martin's objection is valid.

          Josh



More information about the Concurrency-interest mailing list