You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running in single thread mode certain operations may cause a deadlock. The following are the cases where deadlocks may occur.
Contended monitor enters
If the JVM attempts to acquire a lock that is held by another application thread, this would cause a deadlock since in this mode only a single application thread can be active.
In this mode the JVM will throw an exception for any contended monitor acquisition, either by bytecode (monitorEnter) or by JNI (MonitorEnter) or java.util.concurrent.locks.Locks.
In this mode we will also throw for Thread.join()
Terminal operations
Some operations force the thread to block and require another thread to enable resumption. Given that only single thread can be run at a time this would cause a deadlock
An internal list of known methods that exhibit this behaviour will be created. Examples are sun.misc.Unsafe.park(), java.lang.Thread.suspend.
Upon entry to these methods the JVM will throw an exception
Potentially terminal operations
Some operations that rely on external resources (sockets, file handles, etc.) may exhibit terminally blocking behaviour if there is a failure in the external system. These cases are addressed by the use of the timeout thread.
Launch timeout thread that will interupt Java hooks if it exceeds a certain threshold
Notify
Notify potentially transfers control from from the calling thread to the another that is waiting on it. Under normal circumstances it would be acceptable to send notify() and release the lock, then attempt to re-acquire it at another time. However, in single thread mode this will trigger a deadlock.
The JVM will delay all notify operations until the end of the single thread phase
Temporary blocking operations
Some operations will block temporarily
Thread.onSpinWait(), yield(), this should be a no-op in single thread mode
The text was updated successfully, but these errors were encountered:
tajila
added
comp:vm
criu
Used to track CRIU snapshot related work
beta
Used to track items that will be included in a feature beta release
labels
Feb 23, 2022
This PR delays notify/notifyAll operations by intercepting the
Object.notify* INLs and saving the instances and operations to a queue.
These instances must be saved as global JNI refs as we cannot save them
in localref storage and disallowing a GC is not feasible. At the end of
the single thread phase all the operations will be executed by the
checkpointing thread.
See eclipse-openj9#14584
Handles case 4) Notify
Signed-off-by: Tobi Ajila <atobia@ca.ibm.com>
When running in single thread mode certain operations may cause a deadlock. The following are the cases where deadlocks may occur.
The text was updated successfully, but these errors were encountered: