customer poller

Alan Bateman Alan.Bateman at oracle.com
Fri Oct 7 07:48:05 UTC 2022


On 06/10/2022 20:19, dreamlike_ocean lei wrote:
> hi,I found that the implementation of "sun.nio.ch.PollerProvider" can 
> be specified through "jdk.PollerProvider", but the interface of 
> PollerProvider is not public, so how do I pass my poller to jvm?
> My purpose is to add io_uring as an implementation of poller, so that 
> I can poll both network IO and file IO using the same thread,and dont 
> worry carrier will be pinned by file io。
>

There isn't an exported service provider interface here. The 
Poller/PollerProvider code is just the JDK's implementation with some 
basic support to allow a JDK build to include alternative 
implementations.  This shouldn't stop you experimenting with your own 
implementation in your own module/package as the primitives that you 
need to park/unpark are already defined by j.u.c.LockSupport.

Just on io_uring. We do have a prototype implementation of the JDK 
PollerProvider that uses io_uring and works as an alternative to the 
epoll based implementation. That's for network sockets, not files, as 
Poller isn't for async I/O. The integration for files is very different 
and involves some significant refactoring of JDK code to support so 
there is a lot more to that. It will be interesting to hear how you get 
on with file I/O.

-Alan


More information about the loom-dev mailing list