8200179: (se) More Selector cleanup

Alan Bateman Alan.Bateman at oracle.com
Fri Mar 23 15:59:10 UTC 2018


This is another batch of cleanups to the Selector implementations.

The poll based Selector has been in disrepair for some time. JDK-8142872 
attempted to exclude it from the build but it wasn't complete in that 
the poll wrapper class and the native methods are are still compiled. 
There is also some legacy debt from JDK 1.4 where part of the  
implementation was compiled on Windows even though it was never usable 
there. Finally, several source files (both native and java) have been 
importing the wrapper class or its header file. The main change to the 
implementation is that is that changes to the interest ops are queued so 
it avoids all the issues with threads changing the poll array when not 
correctly synchronized with the selector. All tests are passing when 
configured to use this Selector. Once Magnus gets JDK-8200178 into 
jdk/jdk then we can look at excluding it on platforms where it is not 
needed.

This patch also refactors the I/O port based Selector used on Solaris. 
The queuing of changes to the interest ops, and post poll re-queuing to 
re-associate file descriptors, is much simpler now.

The webrev with the changes is here:
    http://cr.openjdk.java.net/~alanb/8200179/webrev/index.html

-Alan


More information about the nio-dev mailing list