[concurrency-interest] ReadMostlyVector ListIterator bug
dl at cs.oswego.edu
Mon Aug 13 09:24:53 EDT 2012
On 08/13/12 08:07, Stanimir Simeonoff wrote:
> Actually, I wanted to see how to implement an iterator over a sequence lock data
> structure. If elements are removed from the middle and then added at the end
> (concurrently) it looks some elements may be skipped. So unless copying the
> entire structure under exclusive lock or a retry loop it won't be a replacement
> for COWArrayList.
> Is my reasoning correct?
Yes. You can imagine the results more simply by just contemplating
using index-by-index access instead of iterators: Changes spanning
more than one position may lead to either skips or revisits.
(More generally: Arrays are great for isolated parallelism;
but lousy for shared concurrency. Mixtures are challenging.)
More information about the Concurrency-interest