RFR: 8366671: Refactor Thread::SpinAcquire and Thread::SpinRelease [v3]
Anton Artemov
aartemov at openjdk.org
Fri Nov 14 15:08:14 UTC 2025
On Thu, 13 Nov 2025 22:11:12 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
> I have some initial comments and I haven't really figured out why we want the SpinSingleSection version vs. the CAS that is there now. The CAS makes a lot more sense to me.
The main purpose is unification, CAS creates a section to be executed with only 1 thread, whereas a critical section is executed 1-by-1 thread. I tried to make it look very similarly.
However, I agree that simple CAS is way more readable. I did not find any other places where a single section would be required. So maybe it is just overengineering. If there is no other use-cases, I am ok to remove it.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28264#issuecomment-3533194228
More information about the hotspot-dev
mailing list