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
There are two threads. The first is where Python runs its code and the second which is run by OpenPsi.
OpenPsi thread calls Python method eat_apple(apple) using GroundedSchema.
Python thread calls Python method check_apples() using GroundedPredicate.
The deadlock happens in the following scenario:
Python thread acquires GIL
OpenPsi starts calling a Python GroundedSchema method
OpenPsi thread locks mutex in the method: PythonEval::call_user_function(...)
OpenPsi waits for the GIL in the PythonEval::call_user_function(...)
Python starts calling a Python GroundedPredicate method
Python waits for the locked mutex in the PythonEval::apply_tv(...)
It seems from the Python perspective PythonEval methods first needs to acquire GIL and the mutex after it. In this case the deadlock does not happen.
Below is a simple usage of OpenPsi which calls methods from Python:
Running this code leads to deadlock.
The text was updated successfully, but these errors were encountered: