Peter Firmstone wrote:
...
Yes I bumped into this recently when creating a concurrent policy implementation, although it was with Enumeration, the backing set cannot be modified while the Enumeration is being read from a loop, the same with the iterator.
...

That depends on the implementation of the Iterator, and the Iterable's related contract. There is nothing prohibiting concurrency-supporting contracts. See, for example, http://download.oracle.com/javase/6/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html#iterator%28%29

I'm planning to make the FastList in outrigger Iterable, and follow the ConcurrentLinkedQueue model. As the results looked in preliminary benchmarking before I went on vacation, the best implementation is based on ConcurrentLinkedQueue.

The issue of remoteness, and allowing remote-related exceptions, is another issue. However, rather than giving up the nice loop syntax we get with Iterable, we could consider wrapping in an unchecked exception.

Patricia

Reply via email to