jeudi 26 décembre 2019

Randomness and multiprocessing [duplicate]

This question already has an answer here:

I've got a c++ program which is executed multiple times in parallel in a python script. The c++ program generates data utilizing rand(). The multiple processes are all generating identical data, presumably because they are all opened at the same time (I use srand(time(NULL)) as the seed.) How do I force the sub processes to diverge?




Aucun commentaire:

Enregistrer un commentaire