On Tue, 30 Mar 2021 13:26:13 GMT, Richard Reingruber <rr...@openjdk.org> wrote:
>> Robbin Ehn has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains two commits: >> >> - Merge branch 'master' into SuspendInHandshake >> - 8257831: Suspend with handshake (review baseline) > > src/hotspot/share/runtime/handshake.hpp line 142: > >> 140: private: >> 141: volatile bool _suspended; >> 142: volatile bool _suspend_requested; > > According to the PR description `_suspend_requested` is an optimization. > >> The "suspend requested" flag is an optimization, without it a dormant thread >> could be suspended and resumed many times and each would add a new >> asynchronous handshake. Suspend requested flag means there is already an >> asynchronous suspend handshake in queue which can be re-used, only the >> suspend >> flag needs to be set. > > I think there are a few places where _suspend_requested is queried by mistake > instead of _suspended. Maybe it would help to prevent this if > _suspend_requested was renamed to something that better describes its > purpose, e.g. _has_async_suspend_handshake or similar. I also think it would be a good idea to rename it with something along those lines. ------------- PR: https://git.openjdk.java.net/jdk/pull/3191