j.u.s.Stream and Fiber

Brian Goetz brian.goetz at oracle.com
Thu Sep 19 16:17:39 UTC 2019


I think what’s being asked for here is the ability to ask (a) that parallel execution happen in fibers instead of raw FJ tasks and (b) adjusting the split/run choices to something more suited to IO-parallel rather than data-parallel operations.  



Sent from my MacBook Wheel

> On Sep 19, 2019, at 4:25 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
>> On 18/09/2019 21:37, Arkadiusz Gasiński wrote:
>> Hi,
>> 
>> Sorry if this was asked already - looked through the mailing list, but
>> couldn't find the answer... And the question is: Are JDK's j.u.s.Stream
>> implementation classes Fiber-aware? For example if I trigger a terminal
>> operation on a parallel stream in the context of a Fiber, would there
>> possibly be new fibers scheduled to process the stream elements? If so,
>> what will be the scope of these additional Fibers?
> If there is parallel execution then it will use ForkJoinPool, no change. It's possible that the fiber executing the terminal operation may temporarily pin its carrier thread when joining (you might see it blocked in externalAwaitDone). I'm sure Doug or Martin will have ideas if it becomes an issue.
> 
> -Alan
> 
> 



More information about the loom-dev mailing list