<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 13/04/2024 17:09, Bruno Ploumhans wrote:<br>
<blockquote type="cite" cite="mid:CAH225Xhwz0sYyN=bnaFEHEVmCBiUPNnNphYLVjBLCVtG+FKCJA@mail.gmail.com"><span style="white-space: pre-wrap">
</span>
<pre class="moz-quote-pre" wrap="">
If there is a well-specified API for uninterruptible channels, it
might be worth moving the logic for `beginBlocking` and `endBlocking`
to `AbstractInterruptibleChannel`.</pre>
</blockquote>
<br>
I don't think that would make sense. The reason the thread has been
interrupted is because something wants to cancel what it are doing
as quickly as possible. It's important that operations on network
channels that block indefinitely are interruptible. The discussion
is focused on FileChannel as it is somewhat questionable whether it
should have been an InterruptibleChannel in the first place. It's
not always feasible, plus you get into issues where a FileChannel is
part of low level infrastructure and used by concurrent threads
accessing different parts of the file. Also when wrapped as
InputStream/OutputStream then the result I/O streams are
interruptible which can be surprising.<br>
<br>
-Alan<br>
</body>
</html>