multiprocessing, what am I doing wrong?

Eric Frederich eric.frederich at gmail.com
Fri Feb 24 12:00:26 EST 2012


I can sill get it to freeze and nothing is printed out from the other
except block.
Does it look like I'm doing anything wrong here?

On Thu, Feb 23, 2012 at 3:42 PM, MRAB <python at mrabarnett.plus.com> wrote:

> 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
> --
> http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120224/f4a6aa5f/attachment-0001.html>


More information about the Python-list mailing list