[Python-Dev] Threading in the Standard Library Tour Part II

Bob Ippolito bob at redivi.com
Mon Aug 16 05:55:05 CEST 2004


On Aug 15, 2004, at 11:48 PM, Aahz wrote:

> On Sun, Aug 15, 2004, Raymond Hettinger wrote:
>>
>> All that being said, a few cautions are in order.  Thread programming 
>> is
>> difficult to get right.  And, its overhead decreases total application
>> performance.  Also, multiple processors cannot boost performance 
>> because
>> Python's Global Interpreter Lock (GIL) precludes more than one thread
>> from running in the interpreter at the same time (this was done to
>> simplify re-entrancy issues).  Another issue is that threading doesn't
>> work with the event driven model used by most GUIs.
>
> Python threading certainly does work with GUIs, and while the GIL adds
> some difficulty, the overall simplicity of Python's thread model makes
> it easier to get threaded GUI programs correct.  See the Tkinter 
> example
> from my OSCON slides.

Many platform GUIs require that all or most all GUI activities be 
consolidated to one and only one thread.  I don't think any of them 
'care' if another thread is also running, but it can't communicate 
directly with the GUI.

-bob


More information about the Python-Dev mailing list