<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I understand, but with a PT thread being a GC, and methods like Thread.enumerate() is was never possibly - and a “service” could always find the “blocked” threads and interrupt them.<div class=""><br class=""></div><div class="">If VT are not findable (or optionally findable), I think it is a breaking change which goes against the JEP design for virtual threads, and it is going to lead to two different types of patterns for queue handling based on the thread types involved - I think this is a very bad idea.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 3, 2024, at 9:53 AM, Attila Kelemen <<a href="mailto:attila.kelemen85@gmail.com" class="">attila.kelemen85@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">The assumption is that the thread can provably never continue. That implies `stop` never being called. So, there is no observable difference.</div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">robert engels <<a href="mailto:rengels@ix.netcom.com" class="">rengels@ix.netcom.com</a>> ezt írta (időpont: 2024. júl. 3., Sze, 16:38):<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class="">But won’t that be a breaking api change:<div class=""><br class=""></div><div class=""><div style="color:rgb(64,64,64);background-color:rgb(255,255,255);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;line-height:18px;white-space:pre-wrap" class=""><div class=""><span style="color:rgb(146,205,120)" class="">/**</span></div><div class=""><span style="color:rgb(146,205,120)" class=""> * Retrieves and removes the head of this queue, waiting if necessary</span></div><div class=""><span style="color:rgb(146,205,120)" class=""> * until an element becomes available.</span></div><div class=""><span style="color:rgb(146,205,120)" class=""> *</span></div><div class=""><span style="color:rgb(146,205,120)" class=""> * </span><span style="color:rgb(63,151,223)" class="">@return</span><span style="color:rgb(146,205,120)" class=""> the head of this queue</span></div><div class=""><span style="color:rgb(146,205,120)" class=""> * </span><span style="color:rgb(63,151,223)" class="">@throws</span><span style="color:rgb(146,205,120)" class=""> </span><span style="color:rgb(70,224,192)" class="">InterruptedException</span><span style="color:rgb(146,205,120)" class=""> if interrupted while waiting</span></div><div class=""><span style="color:rgb(146,205,120)" class=""> */</span></div><div class=""> <span style="color:rgb(70,224,192)" class="">E</span> <span style="color:rgb(99,99,36)" class="">take</span>() <span style="color:rgb(63,151,223)" class="">throws</span> <span style="color:rgb(70,224,192)" class="">InterruptedException</span>;</div></div><div class=""><br class=""></div><div class="">For example, given this code:</div><div class=""><br class=""></div><div class="">T timedGetElement() throws InterruptedException {</div><div style="" class=""> Timer t = Timer.start();</div><div class=""> try {</div><div class=""> return queue.take();</div><div class=""> } finally {</div><div class=""> t.stop();</div><div class=""> }</div><div class="">}</div><div class=""><br class=""></div><div class="">With the proposed changes, stop() may never be called - leading to potential resource leaks.</div><div class=""><br class=""></div><div class="">Whereas currently the rules ensure stop() will be called unless the application hard terminates. This would essentially equating thread “death” with a hard application termination from an observability standpoint.</div><div class=""><br class=""></div><div class="">You would have similar issues with any tracing/logging type frameworks.</div><div class=""><br class=""></div></div></div></blockquote></div></div>
</div></blockquote></div><br class=""></div></body></html>