RFR: 8312777: notifyJvmtiMount before notifyJvmtiUnmount [v2]

Serguei Spitsyn sspitsyn at openjdk.org
Thu Oct 19 15:28:34 UTC 2023


On Thu, 19 Oct 2023 09:33:49 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> JVMTI is notified after a virtual thread unmounts. Right not, this notification is done after the virtual thread has finished parking or yielding so it's possible for the virtual to continue, and be mounted on a different carrier, before the unmount notification has completed on the original carrier. If this happens it means the the JVMTI mount and unmount notifications will race and it's possible they could be unbalanced. The unmount notification needs to move to after the unmount and before the virtual thread state is changed.
>> 
>> While in the area, I've removed @ChangesCurrentThread from VirtualThread.run. This annotation was in place to workaround an issue with the notifyJvmtiXXX instrinsics, fixed recently by JDK-8316130.
>> 
>> Testing: tier1-6.
>
> Alan Bateman has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Move JVMTI notifications to mount/unmount
>  - Merge
>  - Initial commit

Thank you for the update. It looks good to me.
Thanks,
Serguei

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

Marked as reviewed by sspitsyn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/16194#pullrequestreview-1688045068


More information about the serviceability-dev mailing list