[concurrency-interest] Questions about ArrayDeque
forax at univ-mlv.fr
Fri Jul 21 19:04:12 EDT 2006
Joshua Bloch wrote:
> On 7/21/06, Rémi Forax <forax at univ-mlv.fr> wrote:
>> To josh, perhaps i am tired, but for me, allocateElements() always
>> a power of two size.
> Fair enough...
>> The other invariant is that head and tail must be
>> 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.
More information about the Concurrency-interest