Using blocking IO in fibers
Alan Bateman
Alan.Bateman at oracle.com
Tue Oct 15 15:39:40 UTC 2019
On 15/10/2019 15:37, lxsameer wrote:
> Hi folks,
> I'm interested to learn about the implementation of fibers, specially about how do you park a fiber when it's gonna block. Do you have a way to find out about external blocking IO on a fiber ? Would you mind giving me really quick and brief overview of the implementation or point me to the code please ?
>
The Project Loom update from JVMLS 2019 [1] might be useful. About 7mins
in, we used ServerSocket::accept as an example and you'll see the code
path (in the form of a stack trace) to see how the yielding when there
are no connections to accept. We follow that with the unpark/continue
when a connection is ready to be accepted.
-Alan
[1] https://www.youtube.com/watch?v=NV46KFV1m-4
More information about the loom-dev
mailing list