RFR: 8249004: Reduce ThreadsListHandle overhead in relation to direct handshakes [v6]

Coleen Phillimore coleenp at openjdk.java.net
Fri Nov 5 16:51:21 UTC 2021


On Fri, 5 Nov 2021 15:38:27 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> Should the ThreadsListHandle protect JvmtiThreadState::first also?  If state->next() needs it why doesn't the first entry need this?  There's no atomic load on the _head field.
>
> The `ThreadsListHandle` protects `JavaThread` objects not `JvmtiThreadState` objects.
> `JvmtiThreadState::first()` returns the head of the global list of `JvmtiThreadState`
> objects for the system. Each `JvmtiThreadState` object contains a `JavaThread*` and
> we have to protect use of the `JavaThread*` which can happen in the
> `recompute_thread_enabled(state)` call below.

JvmtiThreadState objects point to JavaThread and vice versa, so I still don't see why you don't protect the first element.

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

PR: https://git.openjdk.java.net/jdk/pull/4677


More information about the serviceability-dev mailing list