Request for review / feedback: SocketChannel.poll()

Rob McKenna rob.mckenna at oracle.com
Wed Oct 2 21:13:21 PDT 2013


Thanks for that David. I'll prepare a new webrev shortly. I've just 
noticed too that I forgot to remove the pollingThread field. Please 
ignore that.

     -Rob

On 03/10/13 04:18, Alan Bateman wrote:
> On 02/10/2013 14:03, David M. Lloyd wrote:
>> :
>>
>> 1. Thread interruption should stop the poll, but absolutely should 
>> not *not* close the channel - that was a bad idea at its inception 
>> and it is still a bad idea now, and people who do not want this 
>> behavior (== sane people) will still be stuck with using temporary 
>> selectors.  It is up to the application to decide what thread 
>> interruption means. InterruptedIOException is more appropriate, and 
>> the user can elect to close the channel if they feel it is 
>> appropriate to do so. Inconsistency is worthless if the existing 
>> behavior does not make sense.
> You are correct that there is a bug in the proposal as the poll is 
> supposed to behave in the same way as Selector.select when interrupted 
> (which means it is supposed to wakeup the poll).
>
> I don't have time to debate your comments on InterruptedIOException as 
> that was totally broken, we don't want to go back there.
>
> -Alan.



More information about the nio-dev mailing list