customer poller
dreamlike_ocean lei
dreamlike.vertx at gmail.com
Fri Oct 7 09:59:18 UTC 2022
PanamaUring/FileTest.java at master · dreamlike-ocean/PanamaUring
(github.com)
<https://github.com/dreamlike-ocean/PanamaUring/blob/master/src/test/java/FileTest.java>
just like this toy code,Use epoll to handle network io, use io_uring to
handle file io, and use eventfd to allow epoll to monitor the completion of
io_uring。
When the eventfd is obtained through epoll_wait, call the io_uring_peek_cqe
method
Alan Bateman <Alan.Bateman at oracle.com> 于2022年10月7日周五 15:48写道:
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20221007/f3377a6d/attachment.htm>
More information about the loom-dev
mailing list