[Numpy-discussion] numpy.random and multiprocessing

Sturla Molden sturla at molden.no
Thu Dec 11 12:21:34 EST 2008


On 12/11/2008 6:10 PM, Michael Gilbert wrote:

> Shouldn't numpy (and/or multiprocessing) be smart enough to prevent
> this kind of error?  A simple enough solution would be to also include
> the process id as part of the seed 

It would not help, as the seeding is done prior to forking.

I am mostly familiar with Windows programming. But what is needed is a 
fork handler (similar to a system hook in Windows jargon) that sets a 
new seed in the child process.

Could pthread_atfork be used?


Sturla Molden



More information about the NumPy-Discussion mailing list