8199791: (se) More Selector cleanup

David Lloyd david.lloyd at redhat.com
Tue Mar 20 14:44:52 UTC 2018

Looks good to me (non-reviewer).  I still believe the timeout calcs
should use System.nanoTime() instead of currentTimeMillis(), and I'd
like to see Linux using eventfd instead of a pipe for selector
wakeups... but those are subjects for future discussion/patches,

On Tue, Mar 20, 2018 at 8:47 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> This is another batch of cleanup to the Selector implementations.
> A significant part of the cleanup is changing the epoll and kqueue based
> Selector implementations to use the EPoll and KQueue support classes. This
> eliminate their wrapper classes and several native methods. The result is
> much smaller implementations. The queuing of changes to the interest set has
> also been re-worked to avoid needing cancellation needing to kill all
> pending updates. A few of the Selector implementations had a native method
> to write a byte to one end of the pipe used for the wakeup mechanism. This
> has been changed to use IOUtil.write1 instead. Interrupting timed polls (as
> in EINTR, not Thread interrupt) wasn't handled correctly in some of the
> implementations so that has been re-worked.
> The webrev with the changes is here:
>     http://cr.openjdk.java.net/~alanb/8199791/webrev/index.html
> I have several other changes for this area but I'd prefer to do the changes
> in small batches to avoid changing too much in one go. Small patches are
> easier to review too of course (and in this case, there is more deletion
> than new code).
> I have run all tests on all platforms several times.
> -Alan


More information about the nio-dev mailing list