<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em ter., 4 de out. de 2022 às 12:33, Florian Schmaus <<a href="mailto:flow@cs.fau.de">flow@cs.fau.de</a>> escreveu:<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Basically, VirtualThread.submitRunContination() [1] submits the virtual <br>
thread's continuation into the fork/join pool. This typically happens <br>
when a virtual thread is unparked, e.g., when it became runnable again <br>
after it was blocked on a synchronization primitive.<br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Work-stealing scheduling is a perfect fit for concurrency platforms like <br>
Loom, and ForkJoinPool already implemented work-stealing. But I was not <br>
the one who decided this, so please do not consider this an <br>
authoritative answer.<br></blockquote></div><div><br></div><div>Is it not the case that a Continuation must always be resumed in the same thread from where it was started?</div><div>(This is my wording for the rule which has been discussed so many times in this list; I'm not sure what is the official wording for this rule.)</div><div>I am assuming that reusing ForkJoinPool here has the intention of allowing any thread in the pool to pick the Continuation up.<br></div><div>If so, then the Continuation may be resumed by any thread in the pool, not necessarily the thread from where it was started.</div><div>How does this work?</div><div><br></div><div>--</div><div> Pedro Lamarão</div><div><br></div></div>