On Tue, 7 Nov 2023 14:44:52 GMT, Patricio Chilano Mateo <pchilanom...@openjdk.org> wrote:
>> Serguei Spitsyn has updated the pull request incrementally with one >> additional commit since the last revision: >> >> review: get rid of the VM_HandshakeUnmountedVirtualThread > > src/hotspot/share/prims/jvmtiEnvBase.cpp line 1974: > >> 1972: >> 1973: if (java_lang_VirtualThread::is_instance(target_h())) { // virtual >> thread >> 1974: if (!JvmtiEnvBase::is_vthread_alive(target_h())) { > > There is only one issue I see in how this check is implemented and the > removal of the VM_op for unmounted vthreads. The change of state to > TERMINATED happens after notifyJvmtiUnmount(), i.e we can see that this > vthread is alive here but a check later can return is not. This might hit the > assert in JvmtiEnvBase::get_vthread_jvf() (maybe this the issue you saw on > your first prototype). We can either change that order at the Java level, or > maybe better change this function to read the state and add a case where if > the state is RUNNING check whether the continuation is done or not > (jdk_internal_vm_Continuation::done(cont)). Thank you for the suggestion. Will check it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16460#discussion_r1386875290