Svein Seldal wrote: > I'm unable to get access to python as long as another python call is > executing. The PyEval_AcquireThread() call blocks until the first call > returns. I was hoping that the python system itself would release the > GIL after some execution, but it itsnt. > > I am dependent upon the ability to have to threads executing in python > land at the same time. How can this be done?
Are you creating your threads through python or through C code? If you are only creating it through C code, then make sure you initialize the GIL with the following call at the beginning of your application: PyEval_InitThreads() From my experience, calling PyGILState_Ensure() was enough. I didn't need to call any extra threading functions. But make sure that every call to PyGILState_Ensure() is matched with a call to PyGILState_Release() -Farshid -- http://mail.python.org/mailman/listinfo/python-list