RFR: 8338417: Explicitly pin a virtual thread before acquiring the JFR string pool monitor [v4]

Markus Grönlund mgronlun at openjdk.org
Wed Aug 21 18:21:26 UTC 2024


> 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

Markus Grönlund 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 four additional commits since the last revision:

 - Merge branch 'openjdk:master' into 8338417
 - update test comment
 - hoist pinVirtualThread
 - 8338417

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20588/files
  - new: https://git.openjdk.org/jdk/pull/20588/files/b96b411f..2cf0c2cb

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20588&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20588&range=02-03

  Stats: 13476 lines in 362 files changed: 8560 ins; 3146 del; 1770 mod
  Patch: https://git.openjdk.org/jdk/pull/20588.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20588/head:pull/20588

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


More information about the core-libs-dev mailing list