RFR: 8253478: (se) epoll Selector should use eventfd for wakeup instead of pipe
Brian Burkhalter
brian.burkhalter at oracle.com
Fri Jan 15 16:35:15 UTC 2021
> On Jan 15, 2021, at 3:31 AM, Alan Bateman <alanb at openjdk.java.net> wrote:
>
> I did experiments with eventfd(2) a few years ago but didn't see any difference at the time. I think it would be useful to include the PR the results from the JMH runs so that there is at least some record of the results.
I’ll do that.
> As regards the patch, I would have expected the only native code is be the method that creates the eventfd instance. The set/reset methods can be implemented with IOUtil.write1/drain1.
Reading or writing fewer than 8 bytes from / to the eventfd object will result in an EINVAL error. Yes, IOUtil.drain(int) could be used instead of EventFD.reset(), although its more complex, but there is no write() in IOUtil which does not require a FileDescriptor and a ByteBuffer, which seems like overkill here. A method IOUtil.write(int fd, long value) could be added however.
> Also I think the EventFD constructor needs a flag so decide the blocking mode, alternative we ignore it and using the existing IOUtil.configureBlocking.
Or maybe better yet just go with hard-coded blocking or non-blocking and dispense with the parameter.
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20210115/250820a9/attachment-0001.htm>
More information about the nio-dev
mailing list