(0.51) Pin virtual threads while they hold raw monitors#21510
Merged
tajila merged 1 commit intoeclipse-openj9:v0.51.0-releasefrom Mar 28, 2025
Merged
(0.51) Pin virtual threads while they hold raw monitors#21510tajila merged 1 commit intoeclipse-openj9:v0.51.0-releasefrom
tajila merged 1 commit intoeclipse-openj9:v0.51.0-releasefrom
Conversation
Our current implementation uses J9VMThread->ownedMonitorCount to track both object monitors and raw monitors owned by a virtual thread. The RI pins a virtual thread while it holds a raw monitor. Our current implementation allows a virtual thread to be unmounted and remounted while holding a raw monitor. This causes J9ThreadMonitor->owner to become invalid, as the virtual thread's J9Thread changes during the unmount and remount phases. Currently, there is no way to track which raw monitors a virtual thread owns. This prevents us from fixing J9ThreadMonitor->owner for raw monitors when a virtual thread is unmounted and remounted. To match the RI, continuationPinCount will be used instead of ownedMonitorCount to pin a virtual thread when it acquires a raw monitor. Fixes: eclipse-openj9#21409 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
babsingh
added a commit
to babsingh/aqa-tests
that referenced
this pull request
Mar 27, 2025
HEAD fix: eclipse-openj9/openj9#21503 0.51 fix: eclipse-openj9/openj9#21510 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
babsingh
added a commit
to babsingh/aqa-tests
that referenced
this pull request
Mar 27, 2025
HEAD fix: eclipse-openj9/openj9#21503 0.51 fix: eclipse-openj9/openj9#21510 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
babsingh
added a commit
to babsingh/aqa-tests
that referenced
this pull request
Mar 27, 2025
HEAD fix: eclipse-openj9/openj9#21503 0.51 fix: eclipse-openj9/openj9#21510 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
This was referenced Mar 27, 2025
karianna
pushed a commit
to adoptium/aqa-tests
that referenced
this pull request
Mar 28, 2025
HEAD fix: eclipse-openj9/openj9#21503 0.51 fix: eclipse-openj9/openj9#21510 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
karianna
pushed a commit
to adoptium/aqa-tests
that referenced
this pull request
Mar 28, 2025
HEAD fix: eclipse-openj9/openj9#21503 0.51 fix: eclipse-openj9/openj9#21510 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Our current implementation uses
J9VMThread->ownedMonitorCounttotrack both object monitors and raw monitors owned by a virtual thread.
The RI pins a virtual thread while it holds a raw monitor. Our current
implementation allows a virtual thread to be unmounted and remounted
while holding a raw monitor. This causes
J9ThreadMonitor->ownertobecome invalid, as the virtual thread's
J9Threadchanges during theunmount and remount phases.
Currently, there is no way to track which raw monitors a virtual
thread owns. This prevents us from fixing
J9ThreadMonitor->ownerfor raw monitors when a virtual thread is unmounted and remounted.
To match the RI,
continuationPinCountwill be used instead ofownedMonitorCountto pin a virtual thread when it acquires a rawmonitor.
Fixes: #21409
Backport of #21503