RFR: 8298853: JvmtiVTMSTransitionDisabler should support disabling one virtual thread transitions
Serguei Spitsyn
sspitsyn at openjdk.org
Mon Dec 19 12:17:51 UTC 2022
On Fri, 16 Dec 2022 02:15:38 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Now the `JvmtiVTMSTransitionDisabler` mechanism supports disabling VTMS transitions for all virtual threads only. It should also support disabling transitions for any specific virtual thread as well. This will improve scalability of the JVMTI functions operating on target virtual threads as the functions can be executed concurrently without blocking each other execution when target virtual threads are different.
>> New constructor `JvmtiVTMSTransitionDisabler(jthread vthread)` is added which has jthread parameter of the target virtual thread.
>>
>> Testing:
>> mach5 jobs are TBD (preliminary testing was completed):
>> - all JVMTI, JDWP, JDI and JDB tests have to be run
>> - Kitchensink
>> - tier5
>
> src/hotspot/share/prims/jvmtiThreadState.cpp line 298:
>
>> 296: HandleMark hm(thread);
>> 297: Handle vth = Handle(thread, JNIHandles::resolve_external_guard(_vthread));
>> 298: if (!java_lang_VirtualThread::is_instance(vth())) {
>
> How can this condition not be true? Should it be an assertion?
The JvmtiVTMSTransitionDisabler has to be a no-op for a non-virtual thread.
It is to avoid different branches for virtual and non-virtual cases and use this in `jvmtiEnv.cpp`:
` JvmtiVTMSTransitionDisabler disabler(thread);`
I've added comments that mark no-op cases.
-------------
PR: https://git.openjdk.org/jdk/pull/11690
More information about the serviceability-dev
mailing list