RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning
Patricio Chilano Mateo
pchilanomate at openjdk.org
Wed Nov 6 17:40:10 UTC 2024
On Wed, 23 Oct 2024 09:58:44 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> src/hotspot/share/runtime/javaThread.hpp line 166:
>>
>>> 164: // current _vthread object, except during creation of the primordial and JNI
>>> 165: // attached thread cases where this field can have a temporary value.
>>> 166: int64_t _lock_id;
>>
>> Following the review I wanted to better understand when `_lock_id` changes. There seems to be another exception to the rule that `_lock_id` is equal to the `tid` of the current `_vthread`. I think they won't be equal when switching temporarily from the virtual to the carrier thread in `VirtualThread::switchToCarrierThread()`.
>
> Right, and we hope this temporary. We had more use of temporary transitions when the feature was initially added in JDK 19, now we mostly down to the nested parking issue. That will go away when we get to replacing the timer code, and we should be able to remove the switchXXX method and avoid the distraction/complexity that goes with them.
I extended the comment to mention this case.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1814189388
More information about the core-libs-dev
mailing list