Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'aahz': 0.03; 'scaling': 0.05; 'socket': 0.05; 'event,': 0.07; 'hettinger': 0.07; 'sun,': 0.09; 'am,': 0.14; 'gui': 0.14; 'wrote:': 0.14; 'collects': 0.16; 'stdin,': 0.16; 'subject:GIL': 0.16; '(i.e.': 0.18; 'model,': 0.19; 'subject:Questions': 0.19; 'device': 0.20; 'maybe': 0.21; 'header:In-Reply-To:1': 0.22; 'raymond': 0.22; 'somehow': 0.23; 'chris': 0.27; 'message-id:@mail.gmail.com': 0.28; 'bound': 0.29; 'sort': 0.30; '17,': 0.31; 'i/o': 0.31; 'queue': 0.31; 'threads': 0.31; 'to:addr:python-list': 0.32; 'on,': 0.33; 'that,': 0.35; 'quite': 0.36; 'event': 0.37; 'data': 0.37; 'some': 0.37; 'variety': 0.37; 'received:209.85': 0.37; 'useful': 0.37; 'apr': 0.38; 'subject:web': 0.38; 'thread': 0.38; 'received:google.com': 0.38; 'user': 0.38; 'but': 0.38; 'to:addr:python.org': 0.39; 'comes': 0.39; 'received:209': 0.39; "it's": 0.40; 'header:Received:5': 0.40; 'waiting': 0.61; '2011': 0.62; 'subject:about': 0.66; 'share': 0.67; 'article': 0.75; '12:44': 0.84; 'received:209.85.210.174': 0.84; 'received:mail- iy0-f174.google.com': 0.84; 'specialty': 0.84; 'subject:services': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=ypqkIDgoMNwMoUPohsmIEL8bsz+Z86zpRlj3xQj6Cmo=; b=YCAttBEi5U+q92vpMk0J+SfapIFCrsxJR9fhcLuk2DKSK+Pzmtdnh4aymrGEqK+nD9 AcrEegHVckk5F2Zx1ADvoO5/O/za5byqAZcawaz0ZROy3V+p+VMNcAUvBSO9HS2VtjnB Gd/QTWPn0yd+YoXCEwjBajoZUzMuaYwH3h4h4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=G1bpw9+hS/PJH9VquJs+gy6gjkiIQcOyGa6UedNWXyXh357uYLLCMbTgcdzmqXvabD 4ZtmP1qvXS5Zo5hghfkCoK1Uzjkl30Xj5Fpl3717YCV00tI5Z+DGL3GJ++VoBSLm2/pA g/i5knbB55lrbK6e3cCH99yAhNZT1IkQwPqu8= MIME-Version: 1.0 In-Reply-To: References: <4DA8734C.1080706@WindsorCircle.com> <1302887012.27269.2.camel@tim-laptop> Date: Sun, 17 Apr 2011 02:04:26 +1000 Subject: Re: Questions about GIL and web services from a n00b From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1302969870 news.xs4all.nl 81475 [::ffff:82.94.164.166]:47470 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3328 On Sun, Apr 17, 2011 at 12:44 AM, Aahz wrote: > In article , > Raymond Hettinger =A0 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