Non interference enforcement

Brian Goetz brian.goetz at oracle.com
Wed Sep 26 06:37:02 PDT 2012


Right.

The existing enforcment uses a nonvolatile count; if we were to check it 
during a forEach (the other option), it would likely be hoisted out of 
the loop anyway.

On 9/26/2012 9:35 AM, Remi Forax wrote:
> On 09/26/2012 03:28 PM, Brian Goetz wrote:
>> We do piggyback on some degree of fail-fast when we use their iterators.
>
> yes, but using an iterator is not mandatory, right ?
>
> Rémi
>
>>
>> On 9/26/2012 9:26 AM, Remi Forax wrote:
>>> We currently ask users to write lambdas that doesn't interfere with the
>>> source collection
>>> of a stream but it's not enforced in the code.
>>>
>>> By example,
>>>    list.stream().forEach(e -> { list.remove(e); });
>>> may works or not depending how the pipeline is implemented.
>>>
>>> This is a serous departure for the current way java.util collections
>>> works
>>> and I wonder if we should not keep the fail-fast guarantee for those
>>> collections.
>>>
>>> Rémi
>>>
>


More information about the lambda-libs-spec-experts mailing list