6346658: (se) Selector briefly spins when asynchronously closing a registered channel [win]

Chris Hegarty chris.hegarty at oracle.com
Mon Feb 20 08:03:04 PST 2012

This looks fine to me.


On 20/02/2012 14:52, Alan Bateman wrote:
> Asynchronous close has always been problematic on Windows, mostly
> because that platform lacks a means to close a file or connection
> without releasing the handle. I'd like to change the implementation so
> that closing a FileChannels or SocketChannel configured non-blocking
> works cooperatively. In the case of FileChannel this means the close is
> postponed until the last thread is finished doing I/O on the channel,
> with SocketChannels registered with Selectors it means the close is done
> when deregistering from the Selector. There isn't any change to
> SocketChannels configured blocking. The webrev with the proposed changes
> is here:
> http://cr.openjdk.java.net/~alanb/6346658/webrev/
> For now I don't have any automated tests to go along with this. I have a
> test for FileChannel but it runs for several hours and so is not
> suitable for the regression suite. All existing tests pass on all
> platforms with these changes.
> -Alan.

More information about the nio-dev mailing list