<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr">The better solution would have the read interrupted in this case with an exception. You can do this today with weak references. </div><div dir="ltr"><br><blockquote type="cite">On Jul 2, 2024, at 11:02 AM, Pedro Lamarão <pedro.lamarao@prodist.com.br> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div dir="ltr">Em seg., 1 de jul. de 2024 às 21:02, Brian S O'Neill <<a href="mailto:bronee@gmail.com">bronee@gmail.com</a>> escreveu:<br></div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
If you depended on virtual threads being GC'd when blocked with a real <br>
infinite timeout, then switching to platform threads would introduce a <br>
memory leak that didn't exist before. Ideally, the two thread types <br>
should be interchangeable.<br></blockquote><div><br></div><div>But what about an "impossible" wait?<br></div><div>A thread in a pseudo-infinite wait will wake eventually, and the platform cannot know if this was intentional or not.<br></div><div><div>But a thread waiting on a blocking queue whose only reference is the thread itself will never wake, since there is no one to insert into the queue.</div><div><br></div></div><div>--<br></div></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Pedro Lamarão</div></div></div></div>
</div></blockquote></body></html>