Hi guys! I am trying to build a C++ application that uses pthreads and embedded python. I've simplified the problem down so that the Python code is a single class that subclasses from Queue. The main thread of the C++ application adds to the queue. A worker thread in the C++ application reads from the queue.
I am using: PyGILState_Ensure() PyGILState_Release() to lock the GIL and release it. I'm finding this situation happening: 1) main thread locks the GIL 2) worker thread locks the GIL 3) main thread tries to release the GIL, but the thread state is not current and the program aborts with this error: Fatal Python error: This thread state must be current when releasing Other times, the program runs to completion, only to segfault just before it exits. C++ code can be found here: http://pastie.org/2035072 Python code can be found here: http://pastie.org/2035086 I've tried several different APIs without any success. This is my first attempt at embedding Python. So, what is correct way to do this? Any suggestions will be appreciated. Thanks! Tom
-- http://mail.python.org/mailman/listinfo/python-list