Questions about GIL and web services from a n00b

Chris Angelico rosuav at
Sat Apr 16 18:04:26 CEST 2011

On Sun, Apr 17, 2011 at 12:44 AM, Aahz <aahz at> wrote:
> In article <e6008cc8-50f0-4d78-be78-ec6e73b974e9 at>,
> Raymond Hettinger  <python at> wrote:
>>Threading is really only an answer if you need to share data between
>>threads, if you only have limited scaling needs, and are I/O bound
>>rather than CPU bound
> Threads are also useful for user interaction (i.e. GUI apps).

I agree; user interaction is effectively I/O on, usually, some sort of
event queue that collects from a variety of sources; with the
specialty that, in some GUI environments, the process's first thread
is somehow "special". But ultimately it's still a "worker thread" /
"interaction thread" model, which is quite a good one. The interaction
thread spends most of its time waiting for the user, maybe waiting for
STDIN, maybe waiting for a GUI event, maybe waiting on some I/O device
(TCP socket comes to mind).

Chris Angelico

More information about the Python-list mailing list