problem to write a THREAD enabled python extension

Stefan Behnel stefan_ml at
Mon Aug 24 17:18:40 CEST 2009

Andreas Otto wrote:
> Hi,
>   the following scenario:
>  1. using GIL
>  2. a pthread is created in a library and have to be "announced" to python
>  3. the thread is created in a "PyObject_CallObject" function call from
>       extension c code using a other extension c-code function called
>       from python code
>  python CRASH with invalid thread-state object

You forgot to create a thread state for the new thread. See the
PyThreadState_New() function.


More information about the Python-list mailing list