Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'args': 0.05; 'reason.': 0.07; 'seemed': 0.07; 'freezes': 0.09; 'from:addr:python': 0.09; 'output': 0.10; 'exception': 0.12; 'method.': 0.15; '"***': 0.16; 'except:': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'method;': 0.16; 'received:84.92': 0.16; 'received:84.92.122': 0.16; 'received:84.92.122.60': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'reply-to:addr:python-list': 0.16; 'subject:wrong': 0.16; 'uncaught': 0.16; 'this:': 0.16; 'wrote:': 0.18; 'maybe': 0.21; 'header:In-Reply-To:1': 0.22; 'runs': 0.23; 'traceback': 0.24; 'code': 0.26; 'import': 0.27; 'raise': 0.28; 'print': 0.29; 'lines': 0.30; 'pasted': 0.30; 'worker': 0.30; 'pretty': 0.31; 'subject:?': 0.31; 'break': 0.32; 'there': 0.33; 'header:User-Agent:1': 0.33; 'eric': 0.34; 'received:84': 0.34; 'reply-to:addr:python.org': 0.34; 'try:': 0.34; 'to:addr:python- list': 0.35; 'something': 0.35; 'subject:skip:m 10': 0.37; 'run': 0.37; 'but': 0.37; '2nd': 0.38; 'resulting': 0.38; 'some': 0.38; 'doing': 0.38; 'sometimes': 0.38; 'except': 0.39; 'called': 0.40; 'to:addr:python.org': 0.40; 'simple': 0.61; 'below': 0.62; 'header :Reply-To:1': 0.70; 'reply-to:no real name:2**0': 0.72 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=ZZifx7pA c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=qePWxsfFzlIA:10 a=FVV0ur5EMoUA:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=11Xoxcku50vVv6KKDAIA:9 a=wPNLvfGTeEIA:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117 X-AUTH: mrabarnett:2500 Date: Thu, 23 Feb 2012 20:42:05 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: python-list@python.org Subject: Re: multiprocessing, what am I doing wrong? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: python-list@python.org 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1330029837 news.xs4all.nl 6978 [2001:888:2000:d::a6]:50782 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20746 On 23/02/2012 17:59, Eric Frederich wrote: > Below is some pretty simple code and the resulting output. > Sometimes the code runs through but sometimes it just freezes for no > apparent reason. > The output pasted is where it just got frozen on me. > It called start() on the 2nd worker but the 2nd worker never seemed to > enter the run method. > [snip] The 2nd worker did enter the run method; there are 2 lines of "2". Maybe there's an uncaught exception in the run method for some reason. Try doing something like this: try: args = self.inbox.get_nowait() except Queue.Empty: break except: import traceback print "*** Exception in worker" print >> sys.stderr, traceback.print_exc() sys.stderr.flush() print "***" raise