[Pyrex] Pyrex and the GIL

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Sep 12 07:24:18 CEST 2005


Bob Ippolito wrote:

>> That's not right either, because when calling
>> out to such a function you need to ensure that
>> the GIL is *not* held.

> Not really, the PyGILState_Ensure() API doesn't care.

The uses I have in mind for declaring an external
function nogil are where the function does something
that you want done with the GIL released, such as
reading from a file. The function itself probably
knows nothing about Python.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+



More information about the Pyrex mailing list