[Python-Dev] Extension modules, Threading, and the GIL

David Abrahams dave@boost-consulting.com
Mon, 30 Dec 2002 13:14:16 -0500


martin@v.loewis.de (Martin v. L=F6wis) writes:

> David Abrahams <dave@boost-consulting.com> writes:
>
>> > Ok. What would break if they wouldn't?
>>=20
>> All of the places where Q invokes the callback on arbitrary threads it
>> has started, but which don't hold the GIL.
>
> So Q creates new threads which perform callbacks? But Q also performs
> the callbacks when invoked from A? Sounds like a bug in Q to me...

Why do you say that?  Q doesn't know anything about Python or its
constraints.  Why should it be prohibited from invoking these
callbacks in whatever way it deems appropriate for its problem domain?

I know, I know, all library authors should design with Python in mind
<wink>, but seriously, Q =3D=3D Qt, a library that's used extensively and
successfully by thousands.  It's conceivable that this is a serious
design flaw in Qt, but I'm inclined to disbelieve that.

I think rather that this is a library design which doesn't
interoperate well with Python's constraints on GIL manipulation.  In
this case, as Python is intended to be good for general
interoperability, it seems like Python ought to budge if possible.

--=20
                       David Abrahams
   dave@boost-consulting.com * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution