[Python-Dev] Release or not release the GIL

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Feb 1 23:16:26 CET 2013


Amaury Forgeot d'Arc wrote:
>     One reasonable heuristic is to check the man page: if the syscall can
>     return EINTR, then the GIL should be released.

Hmmm, curious. According to the MacOSX man pages, both
dup() and dup2() can return EINTR, but pipe() and
socketpair() can't.

I'm particularly surprised about dup(), as that's the
one I would have thought couldn't possibly block -- it
only needs to manipulate in-memory data structures.

For Linux, the only one returning EINTR is dup2().

FreeBSD has none of them returning EINTR.

So it looks like there's a fair bit of variation between
unices here.

-- 
Greg


More information about the Python-Dev mailing list