Skip to content

Conversation

graalvmbot
Copy link
Collaborator

@graalvmbot graalvmbot commented Feb 5, 2024

Based on #6899. This PR contains larger cleanups and changes the code so that it is a lot closer to the original C++ sources (makes maintenance easier).

@roberttoyonaga : please double-check this PR and let me know if I removed anything relevant.

… fields by lock access. Restrict access in JfrThrottler.
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 5, 2024
return false;
}

return activeWindow.sample();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @christianhaeubl this reverts the read-write lock changes. Doesn't this still have the same problems you were concerned about (#6899 (comment)).

A window may expire after a thread has checked expiry status but before it has sampled with respect to it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I removed the read/write lock because I don't think that this race can cause any relevant problems (that is probably also the reason why HotSpot doesn't guard against it).

@roberttoyonaga
Copy link
Collaborator

Thank you for working on integrating this. Apart from my comment above, the sampling logic and tests all seem fine to me.

@christianhaeubl
Copy link
Member

Thanks for double-checking.

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