FileChannel implements InterruptibleChannel, help or hindrance?

Alan Bateman Alan.Bateman at oracle.com
Sun Mar 4 17:10:27 UTC 2018


On 01/03/2018 14:57, David Lloyd wrote:
> :
> Yes please.  In general, interrupt handling in I/O and NIO has been a
> problem for us, to the point where we have implemented utilities in
> our thread implementation to defer interrupts over a block of code
> e.g. a lambda.
Is that interrupting file I/O with FileChannel or do you mean the 
network channels? I wasn't involved in JSR-51 but I believe an important 
use-case at the time was to be able to interrupt tasks in a thread pool 
that may be blocked in socket operations. I'm less sure about 
FileChannel as file I/O operations don't usually block indefinitely, at 
least not without NFS or other networked file system.

> :
> It would be nice if InterruptibleChannel could be deprecated and
> completely neutralized across the board as its behavior has been much
> more harmful than beneficial in every case I've ever encountered it.
The other aspect to InterruptibleChannel is asynchronous close, 
something that is really important for network oriented channels.

-Alan


More information about the nio-dev mailing list