Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #31435 > unrolled thread

Re: .parallelStream()

Started bySebastian <news@seyweiler.dyndns.org>
First post2015-04-01 16:42 +0200
Last post2015-04-01 16:42 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.java.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: .parallelStream() Sebastian <news@seyweiler.dyndns.org> - 2015-04-01 16:42 +0200

#31435 — Re: .parallelStream()

FromSebastian <news@seyweiler.dyndns.org>
Date2015-04-01 16:42 +0200
SubjectRe: .parallelStream()
Message-ID<mfh040$icm$1@news.albasani.net>
Am 01.04.2015 16:08, schrieb Stefan Ram:
>    I read somewhere that streams can be executed in parallel.
>
>    Somewhere else I read, that one needs to call
>    ».parallelStream()« for parallel execution.
>
>    So, do I get it right, that the JVM will never execute a
>    stream obtained by ».stream()« in parallel, even if it can
>    detect that this will be faster and yield the same outcome,
>    unless the programmer has explicitly enabled this via
>    ».parallelStream()«?
>
Yes. You may also use stream().parallel().

There is no place for implicit parallelism anywhere in Java. The aim in 
designing the Streams API was to make it "unobtrusive".

-- Sebastian

[toc] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web