January 23rd, 2012, 06:27 AM
Creating multiple python interpreter from C threads
I am trying to create multiple python interpreter using Py_NewInterpreter() function in C++ thread. When i run the code sometime it works but sometime it just hanged .Looks like some threads are waiting to acquire the lock which has not been released and thats why a deadlock.
void *threadFunc(void *arg)
tState = Py_NewInterpreter();
mainThreadState = PyThreadState_Get();
for(i=0; i<10; i++)
pthread_create(&p, NULL, threadFunc, (void *)argv);
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.