8200583: (se) Selector clean-up, part 4

Brian Burkhalter brian.burkhalter at oracle.com
Thu Apr 5 00:15:53 UTC 2018


On Apr 4, 2018, at 12:54 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:

> 1. SelectorKeyImpl.channel is changed to a private field. The Selector implementation are changed to use the key's translateXXX and getFDVal methods (essentially ski.channel.$M -> ski.$M).
> 
> 2. The /dev/poll handles EINTR in native code which is inconsistent with the other implementations. I've changed this, and also removed change it to include devpoll.h to avoid having a copy of the struct/definitions.

In DevPollSelectorImpl.doSelect() shouldn’t lines 101-111 be inside a loop?

do {
    // lines 101-111
} while (numEntries == IOStatus.INTERRUPTED);

> 3. interestOps doesn't need to queue the translate ops to the Selectors. Instead the Selectors just need the key. This reduces the need to update the registrations in the kernel when the same key is changed more than once. Related is that implRegister doesn't need the key in most implementations, it can register when the interest ops are initially set.
> 
> The changes should be easy to review. The tests are passing on all platforms.
>    http://cr.openjdk.java.net/~alanb/8200583/webrev/index.html

Aside from the foregoing I did not see any problems.

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20180404/b8f8db38/attachment.html>


More information about the nio-dev mailing list