8199791: (se) More Selector cleanup

Brian Burkhalter brian.burkhalter at oracle.com
Thu Mar 22 00:29:19 UTC 2018


I concur about nanoTime() and eventfd seems like a good idea for the reasons stated in another message but these could be done separately at a later time.

Just a few comments:

EPollPort
33: Could this static import be removed?
92: Could the socket pair creation be moved to just after super()? If so then the try-catch could be eliminated and there would be no need for the current lines 96-97.

EPollSelectorImpl
87: Similar comment as for EPollPort:92 above.

KQueuePort
33: Again, could this static import be removed?
90: Similar comment as for EPollPort:92 above.

KQueueSelectorImpl
88: Similar comment as for EPollSelectorImpl:87 above.

Could DevPollArrayWrapper be dispensed with similarly to {EPoll,KQueue}ArrayWrapper?

I don’t see any logical problems with this so I think it can go ahead.

Brian

On Mar 20, 2018, at 7:44 AM, David Lloyd <david.lloyd at redhat.com> wrote:

> 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,
> probably.
> 
> 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

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


More information about the nio-dev mailing list