2 ms·
> There is legitimate need for reproducible pseudo-random sequences derived from a known random seed. Correct, but rand() / srand() aren't an effective way of
by duskwuff 2y ago
> There is legitimate need for reproducible pseudo-random sequences derived from a known random seed.
Correct, but rand() / srand() aren't an effective way of providing for that need. The state of the RNG is process-global; it rapidly becomes nondeterministic in multithreaded applications, let alone if a library you're using calls rand() internally. And, as mentioned upthread, the algorithm is implementation-defined, and isn't guaranteed to remain the same over time.