Integrated: 8338417: Explicitly pin a virtual thread before acquiring the JFR string pool monitor

Markus Grönlund mgronlun at openjdk.org
Fri Aug 23 09:32:08 UTC 2024


On Wed, 14 Aug 2024 20:53:33 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

> Greetings,
> 
> Explicitly pin a virtual thread before acquiring the JFR string pool monitor because migrating a carrier thread local event writer object onto another carrier thread is impossible.
> 
> During event commit, the thread is in a critical section because it has loaded a carrier thread local event writer object. For virtual threads, a contended monitor, such as a synchronized block, is a point where a thread could become unmounted.
> 
> A monitor guards the JFR string pool, but remounting a virtual thread onto another carrier is impossible because of the event writer.
> 
> Therefore, it's imperative to use explicit pin constructs to prevent unmounting at this location. 
> 
> Testing: jdk_jfr
> 
> Thanks
> Markus

This pull request has now been integrated.

Changeset: 69bd227e
Author:    Markus Grönlund <mgronlun at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/69bd227e6c497eb82c46ab85125610c0b44dc04e
Stats:     226 lines in 6 files changed: 189 ins; 10 del; 27 mod

8338417: Explicitly pin a virtual thread before acquiring the JFR string pool monitor

Reviewed-by: alanb, egahlin, dholmes

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

PR: https://git.openjdk.org/jdk/pull/20588


More information about the hotspot-jfr-dev mailing list