[Pyrex] Pyrex and the GIL

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Sep 9 05:33:34 CEST 2005


Grant McDonald wrote:

> Do we base the behaviour on a combination of the calling scope and the 
> function requirements?

Yes. Pyrex always knows whether the calling scope hold the
GIL. (Currently it assumes that the GIL is always held inside
Pyrex code, although that could be relaxed.)

All it needs to be told is the requirement of the function
being called. There are two possibilities, it requires the
GIL to be held, or it requires it to be released. For
compatibility with the status quo, the default must be to
assume that it requires the GIL held. That leaves us
with one declaration meaning "this function requires the
GIL to be released".

(There is actually a third possibility, that the function
doesn't care whether the GIL is held or not, but I would
need convincing that it's worth trying to accommodate this
possibility.)

-- 
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