Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin virtual threads in JVMTI RawMonitorEnter and RawMonitorExit #16790

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

babsingh
Copy link
Contributor

JVMTI functions RawMonitorEnter and RawMonitorExit can be invoked
from Java code using native methods.

ownedMonitorCount is incremented for the current J9VMThread in
RawMonitorEnter after successfully acquiring the monitor, and
it is decremented for the current J9VMThread in RawMonitorExit
after successfully releasing the monitor.

This prevents virtual threads to yield if it owns a monitor.

Related: #16753

JVMTI functions RawMonitorEnter and RawMonitorExit can be invoked
from Java code using native methods.

ownedMonitorCount is incremented for the current J9VMThread in
RawMonitorEnter after successfully acquiring the monitor, and
it is decremented for the current J9VMThread in RawMonitorExit
after successfully releasing the monitor.

This prevents virtual threads to yield if it owns a monitor.

Related: eclipse-openj9#16753

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
@babsingh babsingh requested a review from tajila February 28, 2023 14:10
@tajila
Copy link
Contributor

tajila commented Feb 28, 2023

jenkins compile win jdk8

@tajila
Copy link
Contributor

tajila commented Feb 28, 2023

jenkins test sanity alinux64 jdk19

@babsingh
Copy link
Contributor Author

babsingh commented Mar 2, 2023

@pshipton This PR is needed for Java 19. Should it be backported to both 0.37 and 0.38 release branches?

@tajila
Copy link
Contributor

tajila commented Mar 2, 2023

I think we decided that the JDK19 M1 would be split from head since we weren't very diligent in backporting JDK19 changes

@pshipton
Copy link
Member

pshipton commented Mar 2, 2023

This only affects Java 19 / virtual threads? If so it's only needed in 0.37 branches.

@pshipton
Copy link
Member

pshipton commented Mar 2, 2023

We split Java 19 (0.37) at the same time as 0.38, on Feb 21.
https://openj9.slack.com/archives/C8PQL5N65/p1676989172280469

@tajila
Copy link
Contributor

tajila commented Mar 2, 2023

We split Java 19 (0.37) at the same time as 0.38, on Feb 21.
https://openj9.slack.com/archives/C8PQL5N65/p1676989172280469

Okay, I missed that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants