[concurrency-interest] ReadMostlyVector ListIterator bug

Stanimir Simeonoff stanimir at riflexo.com
Mon Aug 13 08:07:30 EDT 2012


On Mon, Aug 13, 2012 at 2:18 PM, Doug Lea <dl at cs.oswego.edu> wrote:

> On 08/12/12 15:33, Stanimir Simeonoff wrote:
>
>> ReadMostlyVector contains a bug in the iterator logic if previous() and
>> next()
>> are used together.
>>
>
> Thanks for the report; sorry for the problems. This is fixed in
> next commit.
>
> No problems at all. I spotted the bug looking at source code only, then
wrote the test case to help clear the bug.

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?

Thanks
Stanimir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20120813/0cfd8775/attachment.html>


More information about the Concurrency-interest mailing list