Processing-Mode Equality

Mike Duigou mike.duigou at oracle.com
Mon Feb 10 16:45:58 PST 2014


On Feb 8 2014, at 10:53 , Brian Goetz <brian.goetz at oracle.com> wrote:

>> The main reason for the sequential mode is that a lot of Java
>> programmers are imperative-minded, and they'll want to pass in
>> functions with side effects.
> 
> No, this is wrong.  The main reason for the sequential "mode" is that 
> sometimes the performance characteristics of a solution favor sequential 
> execution.

ie. Amdahl's law is still in effect and many problems still won't benefit from parallelization. It would be unacceptable for the Streams API to force users onto the "wrong side of the law", whether sequential or parallel, for a particular problem. Until Streams the only out-of-box solutions provided in Java were sequential and were of very limited help in solving problems that could be done in parallel. Fork/Join and primitives require too much extra developer effort to consider them as general solutions. Parallel solutions are now provided in Java 8 via Streams and these parallel solutions will sometimes be the most applicable.

Mike


More information about the lambda-dev mailing list