<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 31/05/2024 20:38, Robert Engels wrote:<br>
<blockquote type="cite" cite="mid:C321304A-4A3C-483F-878E-FB254A631CA3@me.com">
<pre class="moz-quote-pre" wrap="">Hi,
An interesting question came up on the Go support channels. One of the principle engineers stated that for local file IO, the Go routine (similar to virtual thread) won’t release the carrier thread.
Is this the same with Java virtual threads? Yes, local IO is typically fast - but it is still order of magnitudes slower than memory computations - which the virtual thread could be doing while waiting for the IO request to be serviced.
</pre>
</blockquote>
As things stand, file I/O operation do capture the carrier. For
local files and most where it is almost always buffered I/O then it
shouldn't be much of an issue. If files are opened for direct I/O,
or with the synchronized I/O options (think O_SYNC), the target
parallelism is increased for the duration of the I/O operation so
there is a spare carrier available for other virtual threads to make
progress.<br>
<br>
There has been exploration into using asynchronous I/O, and
io_uring, for the implementations but there isn't a conclusion at
this time. Main thing is the bookkeeping and overhead when doing
file I/O ops that may take only a few microseconds.<br>
<br>
-Alan<br>
</body>
</html>