extension call backs and the GIL

Robin Becker robin at jessikat.fsnet.co.uk
Mon Sep 29 06:41:22 EDT 2003


I'm trying to better my understanding of multithreading. I believe a
thread that calls an extension must have the GIL. What happens if the
extension then calls back into Python? Can a function or method somehow
'belong' to a different thread? My understanding was that things should
be OK provided the extension code doesn't mess with the GIL (which it
doesn't).

I'm asking because the ReportLab tool kit contains an accelerator for a
stringWidth function that relies on a callback to fill in some global
data upon demand. A user reports thread problems when using the
accelerator.
-- 
Robin Becker




More information about the Python-list mailing list