[Python-Dev] GIL Pep commentary

David Abrahams dave@boost-consulting.com
Tue, 25 Feb 2003 16:17:02 -0500


Hi,

I just started looking over the GIL pep
http://www.python.org/peps/pep-0311.html. Looks pretty nice to me so
far!  I have these remarks:

   "This API will not perform automatic initialization of Python, or
    initialize Python for multi-threaded operation.  Extension authors
    must continue to call Py_Initialize(), and for multi-threaded
    applications, PyEval_InitThreads()."

This is liable to confuse people (like me) who have never had to do
Py_Initialize or PyEval_InitThreads in their extension modules.


   "It is intended that this API be all that is necessary to acquire
    the Python GIL.  Apart from the existing, standard
    Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS macros, it is
    assumed that no additional thread state API functions will be used
    by the extension.  Extensions with such complicated requirements
    are free to continue to use the existing thread state API."

This sounds like it's saying you can't use any of the old thread API
functions if you use the new ones.  Is that right?  If so, I think it
should be made more explicit.  Seems a bit draconian, though I admit I
don't know what other thread API functions people might want.

Good job, Mark!
-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com