JVMTI resume and suspend for virtual and carrier threads

Babneet B Singh sbabneet at ca.ibm.com
Mon Apr 3 16:24:24 UTC 2023


I would like to request clarification on how JVMTI resume and suspend work for a virtual thread and its associated carrier thread.

Virtual thread runs on a carrier thread. Both are separate Java objects. JVMTI functions can be invoked separately on them. What is the relationship between the state of a virtual and carrier thread when JVMTI suspend and resume functions are invoked on them?

jvmti->SuspendThread(virtualThread) // Will this also suspend the carrier thread?
jvmti->SuspendThread(carrierThread) // Will this also suspend the virtual thread?
jvmti->ResumeThread(virtualThread) // Will this resume both virtual thread and its carrier thread?
jvmti->ResumeThread(carrierThread) // Will this just resume the carrier thread and virtual thread will stay suspended?

Can someone please provide the exact behaviour for the above JVMTI calls?

Regards,
Babneet





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20230403/922c9da7/attachment-0001.htm>


More information about the loom-dev mailing list