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
Nested imports cause deadlocks. The deadlock is caused by native libraries which are loading (indirectly) other native libraries before calling "LEAVE_JyNI". Then the next JyNI_loadModule (JyNI.c) call will stop at ENTER_JyNI.
One possible solution might be to add LEAVE_JyNI and ENTER_JyNI around the call of the dynamic load function (return value of _PyImport_GetDynLoadFunc) in _PyImport_LoadDynamicModuleJy (importdl.c) i.e. around line (*p)();
Another solution might be to check in loadModule in JyNI.java, if one was called from the native library and then calls LEAVE_JyNI and at the end of the function restores the state by calling ENTER_JyNI.
Stefan, I would be happy to hear your opinion on that, since I do not know what requirements on this locking mechanism exist.
The text was updated successfully, but these errors were encountered:
Probably using RE_ENTER_JyNI and RE_LEAVE_JyNI instead of ENTER_JyNI and LEAVE_JyNI would fix this. I am actually about to replace ENTER_JyNI and LEAVE_JyNI by RE_ENTER_JyNI and RE_LEAVE_JyNI at all; they were made before redesign of thread state handling in JyNI alpha 3.
So far I was not confident enough about this decision yet and only replaced where needed. You can try to apply this in JyNI_loadModule. RE_ENTER_JyNI and RE_LEAVE_JyNI lock per thread state and not per call, so entering JyNI using the same thread state preserves the lock.
Nested imports cause deadlocks. The deadlock is caused by native libraries which are loading (indirectly) other native libraries before calling "LEAVE_JyNI". Then the next JyNI_loadModule (JyNI.c) call will stop at ENTER_JyNI.
One possible solution might be to add LEAVE_JyNI and ENTER_JyNI around the call of the dynamic load function (return value of _PyImport_GetDynLoadFunc) in _PyImport_LoadDynamicModuleJy (importdl.c) i.e. around line (*p)();
Another solution might be to check in loadModule in JyNI.java, if one was called from the native library and then calls LEAVE_JyNI and at the end of the function restores the state by calling ENTER_JyNI.
Stefan, I would be happy to hear your opinion on that, since I do not know what requirements on this locking mechanism exist.
The text was updated successfully, but these errors were encountered: