Re: multiprocessing, what am I doing wrong?

2012-02-28 Thread Eric Frederich
If I do a time.sleep(0.001) right at the beginning of the run() method, then it completes fine. I was able to run it through a couple hundred times without problem. If I sleep for less time than that or not at all, it may or may not complete. On Mon, Feb 27, 2012 at 9:38 PM, MRAB

Re: multiprocessing, what am I doing wrong?

2012-02-28 Thread MRAB
On 28/02/2012 17:16, Eric Frederich wrote: If I do a time.sleep(0.001) right at the beginning of the run() method, then it completes fine. I was able to run it through a couple hundred times without problem. If I sleep for less time than that or not at all, it may or may not complete. [snip]

Re: multiprocessing, what am I doing wrong?

2012-02-27 Thread Eric Frederich
Still freezing sometimes, like 1 out of 10 times that I run it. Here is updated code and a couple of outputs. code #!/usr/bin/env python import sys import Queue import multiprocessing import time def FOO(a, b, c): print 'foo', a, b, c return (a + b) * c class

Re: multiprocessing, what am I doing wrong?

2012-02-27 Thread MRAB
On 27/02/2012 16:57, Eric Frederich wrote: Still freezing sometimes, like 1 out of 10 times that I run it. Here is updated code and a couple of outputs. [snip] I don't know what the problem is. All I can suggest is a slightly modified version. If a worker that says it's terminating without

Re: multiprocessing, what am I doing wrong?

2012-02-24 Thread Eric Frederich
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 pyt...@mrabarnett.plus.com wrote: On 23/02/2012 17:59, Eric Frederich wrote: Below is some pretty simple code and the

Re: multiprocessing, what am I doing wrong?

2012-02-24 Thread MRAB
On 24/02/2012 17:00, Eric Frederich wrote: 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? [snip] I don't normally use multiprocessing, so I forgot about a critical detail. :-( When the multiprocessing module

multiprocessing, what am I doing wrong?

2012-02-23 Thread Eric Frederich
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.

Re: multiprocessing, what am I doing wrong?

2012-02-23 Thread MRAB
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