8199611: (se) Minor selector implementation clean-up

Alan Bateman Alan.Bateman at oracle.com
Wed Mar 14 14:01:40 UTC 2018


I have a number of patches for the Selector implementations, this 
include a few random cleanups that I would prefer to separate out.

The cleanup patch in the following webrev:
   http://cr.openjdk.java.net/~alanb/8199611/webrev/index.html

The only two interesting changes are:

1. SelectionKey is specified to be thread safe but the readyOps is read 
without synchronization, this is why readyOps changed to volatile.

2. The epoll based Selector iterated over the polled file descriptors 
twice, once to check for wakeup/interrupt, the second to update the 
selected keys. The first iteration can be dropped as the 
wakeup/interrupt can be detected when updating the keys.

All the existing tests pass with these changes on all platforms.

-Alan


More information about the nio-dev mailing list