<div dir="ltr">Hello!<br><br>I am studying Project Loom and thinking about its integration with io_uring, and I wanted to clarify a couple of questions.<br><br>I've studied the implementation of Socket in Java 19 and the integration of epoll and Loom. The idea is clear, Loom thread tries to read from the socket if it fails it goes to sleep, when epoll returns an event Loom thread wakes up and tries to read again. The epoll readiness model integrates well with Loom.<br><br>Io_uring has a different model: completion. The interface itself does the I/O, then returns the result. I understand how to integrate callback-based systems like CompletableFuture or Kotlin Coroutines with this model, but I have absolutely no idea how to make integration with Loom.<br><br>I have the following questions:<br><br>In the current socket implementation, when we need to stop a thread (the socket is not ready) it is saved in Map, where the key is the fd of that socket. When epoll returns the result we take the thread out of Map and keep it running.<br>In case of io_uring we can save Callback (CompletableFuture or Kotlin Continuation), but what would you save in case of Loom? Thread is not suitable since we need to send the result that io_uring returned.<br><br>I assume one way or another we can make an implementation that will return Future. In case of Loom threads, Future.get, which blocks the calling thread will just stop the loom thread, so it's kind of possible to do it without fear of blocking the system thread. But, this is only if we're really on a Loom thread. Take Netty, for example. Netty doesn't use Loom and is unlikely to do so. Request execution will be on one of the Netty Reactor threads, in case of Kotlin Coroutines we can call suspend function on this thread and it won't be blocked (in case of blocking operations we can use IO Dispatcher, in case of io_uring it is asynchronous), but with Loom we can't call future.get, because in this case netty thread will be blocked. How should the integration work properly in this situation?<br><div><br></div><div>Regards,<br></div><div>Ilya Korennoy</div></div>