RFR: 8338383: Implement JEP 491: Synchronize Virtual Threads without Pinning [v12]

Patricio Chilano Mateo pchilanomate at openjdk.org
Mon Oct 28 20:58:33 UTC 2024


On Mon, 28 Oct 2024 01:13:05 GMT, David Holmes <dholmes 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/cpu/x86/sharedRuntime_x86_64.cpp line 2382:
> 
>> 2380:   __ bind(after_transition);
>> 2381: 
>> 2382:   if (LockingMode != LM_LEGACY && method->is_object_wait0()) {
> 
> It bothers me that we have to add a check for a specific native method in this code (notwithstanding there are already some checks in relation to hashCode). As a follow up I wonder if we can deal with wait-preemption by rewriting the Java code, instead of special casing the wait0 native code?

Not sure. We would have to return from wait0 and immediately clear the physical stack from the frames just copied without safepoint polls in the middle. Otherwise if someone walks the thread's stack it will find the frames appearing twice: in the physical stack and in the heap.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21565#discussion_r1819744051


More information about the nio-dev mailing list