RFR: 8253478: (se) epoll Selector should use eventfd for wakeup instead of pipe [v7]

Alan Bateman alanb at openjdk.java.net
Thu Jan 21 19:42:53 UTC 2021


On Thu, 21 Jan 2021 19:30:25 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> src/java.base/linux/classes/sun/nio/ch/EventFD.java line 51:
>> 
>>> 49:     EventFD(boolean blocking) throws IOException {
>>> 50:         efd = eventfd0();
>>> 51:         IOUtil.configureBlocking(IOUtil.newFD(efd), blocking);
>> 
>> This looks okay but the addition of the blocking parameter means you can go back to one of the early iterations and just calling eventfd with the EFD_NONBLOCK. Up to you.
>
> I am not sure I understand this comment as a previous comment preferred `IOUtil.configureBlocking()` to set the blocking state.

The previous comments were in the context of the no-arg EventFD constructor where we expected it would be created in blocking mode. In that context EPollSelectorImpl would use IOUtil.configureBlocking to configure it to non-blocking. In the new version, there is a blocking parameter so EventFD can use IOUtil.configureBlocking when blocking is "false", or specify EFD_NONBLOCK to eventfd, either is okay with me.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2082


More information about the nio-dev mailing list