RFR: 8265754: Move suspend/resume API from HandshakeState [v2]

David Holmes dholmes at openjdk.org
Mon Jun 2 03:54:57 UTC 2025


On Fri, 30 May 2025 09:28:56 GMT, Anton Artemov <duke at openjdk.org> wrote:

>> In order to fully move suspend/resume code outside of `HandshakeState` we should also move `_suspended`/`_async_suspend_handshake`, otherwise we are just adding an extra indirection with class `HandshakeSuspender` IMO. The idea behind this bug was to define suspend/resume and related HandshakeClosure definitions without needing extra knowledge in `HandshakeState`, like any other HandshakeClosures. The reason why this is not straightforward is because of the interaction with the `HandshakeState` lock. But if we are going to give access to it to `HandshakeSuspender` we might as well give it to `JavaThread` instead and move everything there as that’s where all methods naturally belong. Something like this: https://github.com/pchilano/jdk/commit/4e870069e207ad2e8ba11ab1904a8df04961cef3
>
> Thanks @pchilano, I agree that the refactoring I proposed is adding an extra layer. What you propose is moving the functionality to JavaThread. I think we need to come to an agreement on where it should belong to. @dholmes-ora do you have an opinion on that?

@toxaart All the suspend/resume code used to live in JavaThread so we are coming full-circle. :) I don't quite recall the path that led to it being taken out of JavaThread. No objections from me.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25407#issuecomment-2928623550


More information about the hotspot-runtime-dev mailing list