External suspend requests from JVMPI/JVMDI/JVM_Suspend interface marks the
external_suspend flag for the target thread, then target thread will
self-suspend some time later if it is not executing native code. Current
implementation guarantees no new byte code will be executed after the suspend
function returns.
However, if target thread is running native code when the suspend function
is called, it is suspended immediately and non-cooperatively to prevent
deadlock on raw monitors in JVMPI and JVMDI.
Non-cooperative suspension is inherently deadlock-prone as target thread may
be suspended while holding important resources. There have been a number of
bugs on hangs caused by non-cooperative suspensions. On the other hand, a
lot of changes have been made since the 1.3 days in the object monitor area to
make them ready for cooperative suspensions. It is therefore desirable to
turn off the "native_now" flag in JMVPI/JVMDI/JVM_Suspend calls and let threads
running native code self-suspend when they are ready to do so. That also helps
us simplify the suspend/resume logic.
external_suspend flag for the target thread, then target thread will
self-suspend some time later if it is not executing native code. Current
implementation guarantees no new byte code will be executed after the suspend
function returns.
However, if target thread is running native code when the suspend function
is called, it is suspended immediately and non-cooperatively to prevent
deadlock on raw monitors in JVMPI and JVMDI.
Non-cooperative suspension is inherently deadlock-prone as target thread may
be suspended while holding important resources. There have been a number of
bugs on hangs caused by non-cooperative suspensions. On the other hand, a
lot of changes have been made since the 1.3 days in the object monitor area to
make them ready for cooperative suspensions. It is therefore desirable to
turn off the "native_now" flag in JMVPI/JVMDI/JVM_Suspend calls and let threads
running native code self-suspend when they are ready to do so. That also helps
us simplify the suspend/resume logic.
- relates to
-
JDK-4526887 RFE: no forced suspension in VM shutdown
-
- Closed
-