RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v2]

Serguei Spitsyn sspitsyn at openjdk.org
Thu Nov 7 18:33:14 UTC 2024


On Thu, 7 Nov 2024 00:40:26 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:

>>> So at some point I think we need to figure out how to make them go away  ...
>> 
>> Yes, the 2 extension events (`VirtualThreadMount` and `VirtualThreadUnmount`) were added for testing purposes. We wanted to get rid of them at some point but the Graal team was using them for some purposes.
>> 
>>> It's posted before. We post the mount event at the end of thaw only if we are able to acquire the monitor...
>> 
>> The two extension events were designed to be posted when the current thread identity is virtual, so this behavior needs to be considered as a bug. My understanding is that it is not easy to fix. We most likely, we have no tests to fail because of this though.
>> 
>>> That's the path a virtual thread will take if pinned. 
>> 
>> Got it, thanks. I realize it is because we do not thaw and freeze the VM frames. It is not easy to comprehend.
>
>> The two extension events were designed to be posted when the current thread identity is virtual, so this behavior > needs to be considered as a bug. My understanding is that it is not easy to fix.
>>
> If we want to post the mount/unmount events here is actually simple if we also use `JvmtiVTMSTransitionDisabler::VTMS_vthread_mount/unmount`. I included it in the last commit.

Thank you for the explanations and update. The update looks okay.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1833171024


More information about the serviceability-dev mailing list