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

(0.37) Pin virtual threads in JVMTI RawMonitorEnter and RawMonitorExit #16810

Conversation

babsingh
Copy link
Contributor

@babsingh babsingh commented Mar 2, 2023

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
Copy link
Contributor Author

babsingh commented Mar 2, 2023

@pshipton @tajila This is a copy of #16790 for the 0.37 release.

@pshipton pshipton changed the title Pin virtual threads in JVMTI RawMonitorEnter and RawMonitorExit (0.37) Pin virtual threads in JVMTI RawMonitorEnter and RawMonitorExit Mar 2, 2023
@pshipton pshipton added this to the Java 19 0.37 milestone Mar 2, 2023
@pshipton
Copy link
Member

pshipton commented Mar 2, 2023

Will wait until the head stream has gone through a nightly build without a related issue before merging.

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.

2 participants