Constructing parallel streams (original) (raw)
Joe Bowbeer joe.bowbeer at gmail.com
Mon Dec 10 08:01:39 PST 2012
- Previous message: Constructing parallel streams
- Next message: Constructing parallel streams
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I can easily imagine a pipeline that has alternating sequential/parallel/sequential segments. Is there any reason to discourage a programmer from using the parallel/sequential methods to express this? On Dec 10, 2012 7:50 AM, "Brian Goetz" <brian.goetz at oracle.com> wrote:
I don't like users being able to call parallel in the middle of the
stream construction.
I don't love it either. The semantics are perfectly tractible, and the implementation is perfectly straightforward, but the performance is unlikely to be a win in most cases. (I mentioned earlier we would doc that this really should only be done at the head of the pipeline.) I propose to have an interface ParallelizableStream that allows to choose if the user want the sequential or the parallel stream upfront. Yeah, we investigated this direction first. Combinatorial explosion: IntParallelizableStream, etc. However, this could trivially become a dynamic property of streams (fits easily into the existing stream flags mechanism). Then only the head streams would have the property, and if you tried to do parallel() farther down the stream, we could ignore it or even throw ISE. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20121210/7599f3de/attachment.html
- Previous message: Constructing parallel streams
- Next message: Constructing parallel streams
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-experts mailing list