[issue11382] some posix module functions unnecessarily release the GIL

Charles-Francois Natali report at bugs.python.org
Thu Mar 3 12:25:10 CET 2011


Charles-Francois Natali <neologix at free.fr> added the comment:

I didn't even know that Windows had such calls.
But anyway, if we start releasing the GIL around each malloc call, then it's going to get really complicated:

static PyObject *
posix_geteuid(PyObject *self, PyObject *noargs)
{
 	return PyLong_FromLong((long)geteuid());
}

PyLong_FromLong -> _PyLong_New -> PyObject_MALLOC which can call malloc.

As for DuplicateHandle, I assume it's as fast as Unix's dup(2).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11382>
_______________________________________


More information about the Python-bugs-list mailing list