Is Python/C api thread safety enough?

Donnie Leen Kingdom.Lin at yeah.net
Sun Nov 21 00:41:27 EST 2004


Thanks for help.

If the long-running function comes from third-party library such as zlib.compress(), we don't know wether the function is safety for python thread, it may cause error, how could we avoid this if we have to use it?

	

==================================

>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.
>-- 
>http://mail.python.org/mailman/listinfo/python-list
>


Donnie Leen






More information about the Python-list mailing list