Processing-Mode Equality

Frost, Gary Gary.Frost at amd.com
Thu Feb 6 07:09:51 PST 2014


I think this is important.

The expectation of the Œsame result¹ does need to be suitably relaxed.

As an asideŠ. have we considered having Œparallel()¹ take an argument so
that we can control parallel dispatch based on some program state

At present we can¹t easily at runtime decide whether to dispatch in a
parallel or sequential mode.

someStream.parallel().forEach(Š.)

We can approximate with

Stream someStream = getSomeStream();
if (wantParallel){
   someStream = someStream.parallel();
}
someStream.forEach(Š..);

But I think I would prefer

someStream.parallel(wantParallel).forEach(Š.)


Of course we could have parallel() default to parallel(true) for
compatibility.


Gary

On 2/6/14, 8:01 AM, "Maurice Naftalin" <maurice at morninglight.co.uk> wrote:

>I realise that I underspecified the problem at the start. It's not just
>that the results of processing in each mode must produce the same result
>(modulo any expected nondeterminism), but also that the two execution
>modes are equally important ­ for example, the API doesn't provide any
>operations that can only be executed (feasibly) in sequential mode.
>
>Maurice
>
>On 6 Feb 2014, at 13:17, Timo Kinnunen wrote:
>
>> Sameness of Sequential and Parallel?
>> 
>> -- 
>> Have a nice day,
>> Timo.
>> 
>> Sent from Windows Mail
>> 
>> From: Millies, Sebastian
>> Sent: Thursday, February 6, 2014 15:07
>> To: Victor Nazarov, Maurice Naftalin
>> Cc: lambda-dev at openjdk.java.net
>> 
>> it's not quite transparent, in particular because it's explicit and
>>therefore visible.
>> Haven't Brian Goetz and Paul Sandoz used the phrase "unobtrusive
>>parallelism" ?
>> 
>> However, that wording refers more to the manner of specifying a
>>processing
>> mode, not to the relation between them, so perhaps it's not what you're
>>aiming
>> for.
>> 
>> How about: "sequential-parallel conformance" ?
>> 
>> -- Sebastian
>> 
>> -----Original Message-----
>> From: lambda-dev-bounces at openjdk.java.net
>>[mailto:lambda-dev-bounces at openjdk.java.net] On Behalf Of Victor Nazarov
>> Sent: Thursday, February 06, 2014 1:52 PM
>> To: Maurice Naftalin
>> Cc: lambda-dev at openjdk.java.net
>> Subject: Re: Processing-Mode Equality
>> 
>> transparent parallelism?
>> 
>> --
>> Victor Nazarov
>> 
>> 
>> On Thu, Feb 6, 2014 at 4:18 PM, Maurice Naftalin
>><maurice at morninglight.co.uk
>> > wrote:
>> 
>> > In writing about streams, I want to explain how the API has been
>> > shaped by the design goal of maintaining functional equivalence
>> > between parallel and sequential execution. I'm looking for a name for
>> > that goal, but so far the best I've come up with is the Principle of
>> > Processing-Mode Equality, which is pretty clumsy. I'd appreciate
>> > suggestions for improving it (which I will be happy to attribute).
>>Thanks in advance!
>> >
>> > Maurice
>> >
>> >
>> 
>> 
>> Software AG ­ Sitz/Registered office: Uhlandstraße 12, 64297 Darmstadt,
>>Germany ­ Registergericht/Commercial register: Darmstadt HRB 1562 -
>>Vorstand/Management Board: Karl-Heinz Streibich (Vorsitzender/Chairman),
>>Dr. Wolfram Jost, Arnd Zinnhardt; - Aufsichtsratsvorsitzender/Chairman
>>of the Supervisory Board: Dr. Andreas Bereczky -http://www.softwareag.com
>> 
>> 
>
>




More information about the lambda-dev mailing list