T Vergilio wrote:I think it means it will traverse the elements as they were for the very first iteration.
And I suspect it's highly likely to depend on the type of structure.
My understanding of "weakly consistent" is that it
usually means that
next() returns the element mandated by the state of the structure
at the time it was called, but it's also certainly possible for an
Iterator to work on a "snapshot" of the collection taken at the time
the Iterator was created.
This however, takes time, and concurrent structures are generally designed for "high throughput" (or minimum latency) in multi-threaded situations; so it wouldn't be my first choice if I was designing one.
On the other hand, an
Iterator to a "linked" structure might well have to pre-fetch its "next" element when
hasNext() is called in order to conform to the "weakly consistent" spec.
So: quite a few possibilities; and I doubt whether any single one is "right".
Winston