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
Hi,
I'm using python.net in C# app and mainly calling python from worker threads. However it always hangs when trying to acquirelock from different thread than thread that did first initialization.
I'm not familiar with exact workflow with GIL, but for me, adding BeginAllowThreads() and EndAllowThreads() to GILState class helped, but I'm not sure it is proper solution.
The main thread will hold the GIL after initialization until you explicitly release it by calling PythonEngine.BeginAllowThreads() from the main thread (not from your background thread). This is how python threading works, it's not specific to pythonnet.
Hi,
I'm using python.net in C# app and mainly calling python from worker threads. However it always hangs when trying to acquirelock from different thread than thread that did first initialization.
I'm not familiar with exact workflow with GIL, but for me, adding BeginAllowThreads() and EndAllowThreads() to GILState class helped, but I'm not sure it is proper solution.
The text was updated successfully, but these errors were encountered: