Message116671
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 |
|
Date |
User |
Action |
Args |
2010-09-17 14:43:46 | swapnil | set | recipients:
+ swapnil, ncoghlan, nikratio, verigak, anacrolix |
2010-09-17 14:43:46 | swapnil | set | messageid: <1284734626.27.0.316654335805.issue6627@psf.upfronthosting.co.za> |
2010-09-17 14:43:43 | swapnil | link | issue6627 messages |
2010-09-17 14:43:43 | swapnil | create | |
|