[concurrency-interest] Questions about ArrayDeque

Rémi Forax forax at univ-mlv.fr
Fri Jul 21 19:04:12 EDT 2006

Joshua Bloch wrote:

> 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.

sorry about my answer to martin, it was stupid.
ok, i understand now.
perhaps the third paragraph of java.util.Collection doc
can contain a line saying that copy constructor must rely on
the iterator of the collection taken as parameter.

>          Josh

Rémi Forax

More information about the Concurrency-interest mailing list