> > However, while it is waiting for the > > GIL in the UI thread (when the worker thread has it), it is locked into a > > WaitForSingleObject call (some layers below PyGILState_Ensure). > > Obviously the GIL can only be held by one thread at a time. The > question then is why your worker thread isn't periodically releasing the > GIL so the UI thread can grab it. I think this is the key. Since my application embeds Python, I call PyGILState_Ensure in the worker thread to acquire the GIL before doing anything related to Python. I understand Python releases the GIL periodically, but could my call be overriding that? If so, how can I run any Python code and hope to allow other threads to take a stab at getting the GIL?
> The GIL handles this situation just fine, so long as all C code does the > right thing. I don't think we understand you problem well enough to > give you any answers yet though. I understand. I wanted to eliminate as much noise from my post as possible. Thanks for your help. ~Brad _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32