What triggers Fiber.unpark?
Arkadiusz Gasiński
jigga at jigga.pl
Thu Oct 17 19:45:25 UTC 2019
Awesome, thanks!
I think that this YT video link is enough of a record (no pun intended on
the records JEP ;))
Also, I assume that this is only for I/O, right? If a Fiber is waiting for
a lock, it's a different entity that triggers unparking?
Thanks,
Arek
On Thu, Oct 17, 2019, 21:33 Chris Plummer <chris.plummer at oracle.com> wrote:
> On 10/17/19 12:53 AM, Alan Bateman wrote:
> > On 16/10/2019 21:58, Arkadiusz Gasiński wrote:
> >> Just noticed that the previous question in the mailing list was
> >> pretty much
> >> the same (what a coincidence) and actually checked your talk from JVMLS,
> >> @Alan. I’m still wondering what’s calling this InnocuousThread that
> >> in turn
> >> unpark Fiber? Also, is this thread used for all Fiber unparking or
> >> only in
> >> case of I/O?
> >>
> > sun.nio.ch.Poller is probably what you want. The `polled` method is
> > invoked when a file descriptor is ready and it unparks the fiber that
> > is parked waiting on that file descriptor.
> >
> > -Alan
> This part of the video shows the stack when the poll completes and the
> fiber is unparked:
>
> https://youtu.be/NV46KFV1m-4?t=509
>
> Maybe Alan can copy-n-paste the stack trace from the presentation here
> for the record.
>
> Note this is on macos, which uses KQueuePoller. On linux is uses
> EPollPoller. Poller.startPollerThread() is where the InnocuousThread is
> created:
>
> Thread t = JLA.executeOnCarrierThread(() ->
> InnocuousThread.newSystemThread(name, poller));
>
> And the above code is triggered from the Poller static initializer.
>
> Chris
>
>
More information about the loom-dev
mailing list