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

[GR-58381] Synchronize accesses to class init state #9832

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

graalvmbot
Copy link
Collaborator

@graalvmbot graalvmbot commented Oct 7, 2024

This PR adds memory ordering to accesses to HotSpot's InstanceKlass::_init_state field in the Graal JIT, adapting a change introduced in the upstream PR openjdk/jdk#21110.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 7, 2024
@graalvmbot graalvmbot closed this Oct 7, 2024
@graalvmbot graalvmbot merged commit b9b4c7d into master Oct 7, 2024
13 checks passed
@graalvmbot graalvmbot deleted the crefice/GR-58381-class-init-state-atomic branch October 7, 2024 21:02
@zakkak
Copy link
Collaborator

zakkak commented Oct 8, 2024

Hello @c-refice, could you please provide a description for this PR?

I am wondering if this patch would help with the (theoretical) issue described in quarkusio/quarkus#40737 (comment):

if we add concurrency in class initialization there is no way for GraalVM to detect whether all threads have completed or not. That said if a class initializer spawns a thread and returns, the spawned thread can potentially run in parallel with the analysis (e.g. the reachable callbacks) and image building in general which can be problematic...

@alina-yur
Copy link
Member

@zakkak thank you, provided.

@c-refice
Copy link
Contributor

c-refice commented Oct 8, 2024

I am wondering if this patch would help with the (theoretical) issue described in quarkusio/quarkus#40737 (comment):

From what I understood the issue is with a native image build, whereas this change is specific to HotSpot compilations in Graal JIT.

@zakkak
Copy link
Collaborator

zakkak commented Oct 8, 2024

Thank you @alina-yur and @c-refice for the clarifications

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants