RFR: 8154387 - Parallel unordered Stream.limit() tries to collect 128 elements even if limit is less

Paul Sandoz paul.sandoz at oracle.com
Wed Apr 20 08:05:57 UTC 2016


> On 19 Apr 2016, at 18:57, Paul Sandoz <Paul.Sandoz at oracle.com> wrote:
>> The LEAF_TARGET version does not change the results significantly. If
>> you feel that using LEAF_TARGET is more suitable I can update webrev
>> correspondingly.
>> 
> 
> It has some appeal, since there is a symmetry to using that and the threshold at which the wrapping spliterator will no longer be split by F/J tasks. Up to you.
> 

Thinking some more about this, i think it would be preferable. It reduces the explicit referral to ForkJoinPool.getCommonPoolParallelism().

In general the binding the the common pool is an something we want to relax, but its tricky to come up with a sane parallel policy mechanism.

Paul.



More information about the core-libs-dev mailing list