Non interference enforcement

Remi Forax forax at
Wed Sep 26 07:21:43 PDT 2012

On 09/26/2012 04:16 PM, Remi Forax wrote:
> On 09/26/2012 03:37 PM, Brian Goetz wrote:
>> 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.

non-volatile -> not an issue, java.util collection aren't concurrent.

Let's restrict ourselves to the case where the forEach loop and the 
collection mutation appear in the same thread.
The count check is done in the forEach and the mutator increments the 
count so value can *NOT* be hoisted.


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