RFR: 8306034: add support of virtual threads to JVMTI StopThread [v2]

Serguei Spitsyn sspitsyn at openjdk.org
Tue Apr 25 10:17:10 UTC 2023


On Fri, 21 Apr 2023 13:33:53 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> What does "suspended at an event" mean? As a programmer trying to use this how am I supposed to know when it can be used without getting an error?
>> 
>> I find it very surprising that the error would occur with an unmounted thread - having a VT throw when it was remounted seems the most natural way to implement this.
>
> I think "suspended at an event" is okay. It means the callback for an event has been triggered and the agent suspended the thread. The typical use-case for JVMTI StopThread is when at a breakpoint or when single stepping and the user asks the debugger to throw some exception so that the code's handling of the exception can been debugged/tested. Debugger and JDWP agent aside, I don't know if there are other agents using this JVMTI function. If there are other and they call this function on some random virtual thread at some random time then the function will fail.
> 
> One other point around this is that the plan is to have StopThread, ForceEarlyReturn, PopFrame and SetLocalXXX work more consistently. Right now, SetLocalXXX minimally requires a virtual thread be suspended at a breakpoint or single step event. The minimum support can be broader to be suspended at any event.

Alan, thank you for explaining this.
Resolving this conversation.
David, please, reopen it if it is no okay with you.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13546#discussion_r1176306009


More information about the serviceability-dev mailing list