
Dec. 18, 2013
4:02 p.m.
On Wed, Dec 18, 2013 at 9:26 PM, Daniel Pocock <daniel@pocock.com.au> wrote:
b) when each worker thread starts, call PyThreadState_New(mInterpreterState) and save the result in a thread local mPyThreadState
c) use the mPyThreadState with PyEval_RestoreThread and PyEval_SaveThread before and after calling Python methods
Is this a bug in PyGILState_Ensure or is it a deficiency in the documentation?
It doesn't surprise me that you would need to do step b - I do seem to recall the need to call that for each new thread. Not so sure about c. Once you fixed the unrelated bug, do you still need that step? (Been a while since I last embedded Python though, and I might well be wrong.) ChrisA