RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v12]
Richard Reingruber
rrich at openjdk.org
Mon Oct 28 13:18:15 UTC 2024
On Mon, 28 Oct 2024 13:08:37 GMT, Richard Reingruber <rrich at openjdk.org> wrote:
>> Patricio Chilano Mateo has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Restore use of atPointA in test StopThreadTest.java
>> - remove interruptible check from conditional in Object::wait
>
> src/hotspot/share/runtime/objectMonitor.hpp line 202:
>
>> 200:
>> 201: // Used in LM_LEGACY mode to store BasicLock* in case of inflation by contending thread.
>> 202: BasicLock* volatile _stack_locker;
>
> IIUC the new field `_stack_locker` is needed because we cannot store the `BasicLock*` anymore in the `_owner` field as it could be interpreted as a thread id by mistake.
> Wouldn't it be an option to have only odd thread ids? Then we could store the `BasicLock*` in the `_owner` field without loosing the information if it is a `BasicLock*` or a thread id. I think this would reduce complexity quite a bit, woudn't it?
`ObjectMonitor::_owner` would never be `ANONYMOUS_OWNER` with `LM_LEGACY`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1819034645
More information about the serviceability-dev
mailing list