Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:Python': 0.06; 'subject: + ': 0.07; 'subject:code': 0.07; 'worked,': 0.09; 'thread': 0.14; 'aborted': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'scope.': 0.16; 'subject:analysis': 0.16; 'wrote:': 0.18; 'users.': 0.18; 'work,': 0.20; 'header:User-Agent:1': 0.23; 'subject:/': 0.26; 'header:In- Reply-To:1': 0.27; 'went': 0.31; 'code': 0.31; 'problem': 0.35; 'done.': 0.35; 'but': 0.35; 'minutes,': 0.36; 'right?': 0.36; 'doing': 0.36; 'christian': 0.38; 'sometimes': 0.38; 'message- id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'users': 0.40; 'even': 0.60; 'new': 0.61; 'subject:Fwd': 0.61; 'real': 0.63; 'soon': 0.63 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Thu, 27 Nov 2014 17:54:41 -0700 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131118 Thunderbird/17.0.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Fwd: Python Signal/Slot + QThred code analysis References: <5473E188.5020608@gmail.com> <5474A333.2090207@mrabarnett.plus.com> <5474C889.5090503@mrabarnett.plus.com> <547545CF.60208@gmail.com> <5476A134.7050407@gmail.com> <5476A48C.1050607@gmail.com> <5477AB1E.3030609@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1417136088 news.xs4all.nl 2905 [2001:888:2000:d::a6]:44309 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81656 On 11/27/2014 04:29 PM, Juan Christian wrote: > Is that right? But I don't think that always calling the site this way is > good for them and for me, sometimes I may not get new users for like 10~15 > minutes, so I would have wasted a lot of calls for nothing. That's why I > only instantiate/call the site when I get new users. So the real problem with instantiating a worker thread for every request is that you have to hold onto a reference to the worker long enough for the work to be done. Your original code was not doing this, so had it worked, the thread would have been aborted before it even started its work, as soon as the worker instance went out of scope.