8203765: java/nio/channels/Selector/SelectAndClose: add some prints and @intermittent tag

Alan Bateman Alan.Bateman at oracle.com
Wed May 30 07:19:29 UTC 2018


On 30/05/2018 00:21, Brian Burkhalter wrote:
>
> After studying your previous suggestion [1] in detail, I agree that it 
> is better. I have implemented it in the updated patch [2] which has 
> been run through build-and-test on Linux and Windows with 100 test 
> repeats sans failure.
>
Good, I think this is the right approach as it re-works the test now as 
the issues are clear. A few comments:

- no need to add the intermittent tag, that may be left over from your 
original patch

- most of the comment on mightHoldKeySetLock can be replaced with a 
comment to say that selection operations are specified to synchronize on 
the selected key set. Also there is nothing in this method that knows 
anything about selector or the selected-key set so it could be renamed 
(to drop "KeySet") and the comment can be moved to the while loop in 
main where it calls the method with the selected-key set.

- no need for the try/catch around selector.close, it's okay to have the 
main method throw IOException

-Alan





More information about the nio-dev mailing list