On 12/11/2008 4:57 PM, David Cournapeau wrote: > Why do you say the results are the same ? They don't look the same to > me - only the first three are the same.
He used the multiprocessing.Pool object. There is a possible race condition here: one or more of the forked processes may be doing nothing. They are all competing for tasks on a queue. It could be avoided by using multiprocessing.Process instead. > I am not sure I am following: the objects in python are not the same > if you fork a process, or I don't understand what you mean by same. > They may be initialized the same way, though. When are they initialized? On import numpy or the first call to numpy.random.random? If they are initialized on the import numpy statement, they are initalized prior to forking and sharing state. This is because his statement 'from test_helper import task' actually triggers the import of numpy, and it occurs prior to any fork. This is also system dependent by the way. On Windows multiprocessing does not fork() and does not produce this problem. Sturla Molden _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion