Is Python/C api thread safety enough?

Nick Coghlan ncoghlan at email.com
Sat Nov 20 12:12:54 EST 2004


Casper wrote:
> Can sombody tell me is this possible? Thanks first.

If you're going to call the Python C/API, you need to be holding the GIL. So you
either can't release it, or the long-running function has to use
PyGILState_Ensure when it needs to call the Python C/API.

Cheers,
Nick.



More information about the Python-list mailing list