Is there a list collection supporting concurrent modification while iterating?

Viewed 1064

Is there a container implementing the List interface that supports concurrent modification while iterating? Specifically, I wish for one thread to iterate over the collection while many threads insert and remove elements from this list. The iterator should see modifications to the list it hasn't yet traversed.

I'm looking for iteration behaviour similar to a ConcurrentLinkedQueue but with support for adding and removing elements at specific indices. Preferably I'm looking for strong consistency (and am willing to pay lock contention overhead for it) but I could probably live with weak consistency.

I'm happy to look at third-party libraries as I can't see anything in the standard library that provides what I'm looking for.

2 Answers
Related