Hello, first of all my apologies for sending this message to python-dev, but i tried comp.lang.pthon and python-help and didn't get helpful answers. My problem is, that Py_NewInterpreter and the in 2.3 introduced PyGILState API doesn't play nice with each other, especially in multithreaded embedding applications. I think, this is because PyGILState functions assume, there is exactly one PyThreadState instance per thread, and this is violated when using Py_NewInterpreter, which creates a new PyThreadState instance. I've tried to use state = PyGILState_Ensure(); PyThreadState_Get()->interp = interpreterIWantToUse; /* code using Python API */ PyGILState_Release(state); which seems to work, if called from one thread only, but this fails, if used by multiple threads with a "Fatal Python error: PyThreadState_Delete: invalid tstate." Now, most of you would say: "Don't use PyGILState API, use the 2.2 way of dealing with thread states". Unfortunately, i want to use PyQt, which uses the PyGILState API, and i found, that it's not easy (or even impossible?) to mix PyGILState calls with PyEval_SaveThread / PyEval_RestoreThread. I'm lost with this and would appreciate any help. I'm using Python 2.3 on linux x86. Christoph
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4