Lisandro Dalcin wrote: > Some time ago, I've posted some mails about thread issues in Python > 2.3. Unfortunately, those post did not receive any attention. > > Currently, mpi4py on Python 2.3 makes the interpreter segfault. I > could easily fix this issue myself for mpi4py, but perhaps it do make > sense to alleviate other Py2.3 users of this really low-level issue. > > The problem: If at the point PyGILState_Release() is called, the GIL > whas not yet created, then the Python (2.3) interpreter segfautls. > > The solution: Call PyEval_InitThread() in the module init function. > But this could have performance impacts for non threaded applications > using a Cython-generated extension module, so this thread > initialization should be done only if needed. A simple approach is to > call PyEval_InitThread() only if the Cython module ever > released/aquired the GIL > > The attached patch implement all the ideas discussed above. Any chance > to this being accepted? Any better idea? Note that PyEval_InitThread() > is a no-op if the GIL is already created.
Just a quick note that I applied your patch. http://hg.cython.org/cython-devel/rev/9a1f6f7c260a http://hg.cython.org/cython-devel/rev/0bd3bfd487a5 Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
