Endless GIL and thread confusion

Aahz aahz at pythoncraft.com
Thu Nov 1 02:55:22 CET 2007


In article <pan.2007.10.21.16.25.37.300233 at hotmail.com>,
enska  <ensiferum_ at hotmail.com> wrote:
>
>Can someone clarify the steps needed to make access to the interpreter
>safe from multiple threads?
>
>I've been reading the docs for days and I still find them very confusing
>and misleading. For example does the PyGILState_Ensure() function lock the
>GIL or just create the thread state? Is thread supposed to call it once on
>creation and then the release function before exiting or is this the
>preferred mechanism to handle the locking? Most of the confusion stems
>from this segment in the documentation.

If you haven't already, try capi-sig at python.org.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Typing is cheap.  Thinking is expensive."  --Roy Smith


More information about the Python-list mailing list