K
Kirill Simonov
Hi,
Could someone tell me why my extension module works under Python 2.4, but
fails with Segmentation Fault under Python 2.3? Here is the stripped version:
================================================
#include <Python.h>
static PyObject *
test_gil(PyObject *self)
{
PyGILState_STATE gs;
Py_BEGIN_ALLOW_THREADS
gs = PyGILState_Ensure();
PyGILState_Release(gs);
Py_END_ALLOW_THREADS
Py_INCREF(Py_None);
return Py_None;
}
static PyMethodDef test_gil_methods[] = {
{"test_gil", (PyCFunction)test_gil, METH_NOARGS},
{NULL}
};
PyMODINIT_FUNC
init_test_gil(void) {
(void)Py_InitModule("_test_gil", test_gil_methods);
}
===============================================
I've tested it with Debian Sid and Ubuntu Breezy.
Thanks,
Kirill
Could someone tell me why my extension module works under Python 2.4, but
fails with Segmentation Fault under Python 2.3? Here is the stripped version:
================================================
#include <Python.h>
static PyObject *
test_gil(PyObject *self)
{
PyGILState_STATE gs;
Py_BEGIN_ALLOW_THREADS
gs = PyGILState_Ensure();
PyGILState_Release(gs);
Py_END_ALLOW_THREADS
Py_INCREF(Py_None);
return Py_None;
}
static PyMethodDef test_gil_methods[] = {
{"test_gil", (PyCFunction)test_gil, METH_NOARGS},
{NULL}
};
PyMODINIT_FUNC
init_test_gil(void) {
(void)Py_InitModule("_test_gil", test_gil_methods);
}
===============================================
I've tested it with Debian Sid and Ubuntu Breezy.
Thanks,
Kirill