Swapnil Talekar <swapnil...@gmail.com> added the comment:

As far as I know, the thread creation done in the file is not correct. While 
creating threads in C extension, there are certain rules to follow. Firstly, 
Python should be made thread-aware if it is not already i.e. call 
PyEval_InitThreads in the C callback function. After its creation, the thread 
should bootstrap to be able to execute Python code. It should create a new 
PyThreadState for itself by calling PyThreadState_New. For this, the thread 
should be passed the InterpreterState* through the entry function. Before 
executing any Python code, the thread should make sure that the current 
ThreadState * is corresponding to it by calling PyEval_RestoreThread.
Refer 
http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock

----------
nosy: +swapnil

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6627>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to