On Sun, Apr 17, 2011 at 12:44 AM, Aahz <[email protected]> wrote: > In article <[email protected]>, > Raymond Hettinger <[email protected]> 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 -- http://mail.python.org/mailman/listinfo/python-list
