mardi 9 juin 2015

in c#, how to independently guarantee that two machines will not net generate the same random number?

Suppose two machines are running the same code, but you want to offset the timing of the code being run so that there's no possibility of their not running simultaneously, and by simultaneously I mean not running within 5 seconds of each other.

One could generate a random number of seconds prior to the start of the running code, but that may generate the same number.

Is there an algorithm to independently guarantee different random numbers?




Aucun commentaire:

Enregistrer un commentaire