Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #20746 > unrolled thread

Re: multiprocessing, what am I doing wrong?

Started byMRAB <python@mrabarnett.plus.com>
First post2012-02-23 20:42 +0000
Last post2012-02-23 20:42 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: multiprocessing, what am I doing wrong? MRAB <python@mrabarnett.plus.com> - 2012-02-23 20:42 +0000

#20746 — Re: multiprocessing, what am I doing wrong?

FromMRAB <python@mrabarnett.plus.com>
Date2012-02-23 20:42 +0000
SubjectRe: multiprocessing, what am I doing wrong?
Message-ID<mailman.86.1330029837.3037.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web