Parallel-safe lambdas

Stephen Colebourne scolebourne at joda.org
Thu Feb 11 06:30:20 PST 2010


On 11 February 2010 11:11, Mark Thornton <mthornton at optrak.co.uk> wrote:
> Rémi Forax wrote:
>> Mark, I don't think we need to distinguish between restricted
>> and unrestricted closure.
>> I prefer the idea to avoid shared states to let the implementation
>> choose if the code has to be run parallel or not.
>
> I think that is the restriction (no shared state) to which Stephen and
> Olivier are objecting. In fact I think they are saying that shared state
> is so important to their view of lambdas that they would prefer to
> discard the parallel use of lambdas.

Nope. Right now I'm trying to elide to what degree we are meant to be
designing for parallel vs inline.

I certainly don't want to "discard the parallel use of lambdas". I
believe that both parallel and inline are fair and reasonable use
cases for a well-designed lambda implementation. Some others have
indicated that the inline use case should be effectively discarded.

I'd also note that shared state is already common in inner classes
that are the current working implementation of something-like-lambda
in Java. These parallel data races already exist in code today, so
extra restrictions feel heavy handed.

Stephen


More information about the lambda-dev mailing list