Hacker News new | ask | show | jobs
by rurban 1887 days ago
It is a well-known trap that forked or threaded RNG's keep using the same seed. It can be called a feature, eg when you need to process different ranges, using the same sequence of random numbers for each range, but mostly it's a bug. You need to init your rng seed for each thread or fork to get different random sequences.

For splitting up sequential ranges, a good rng typically has an advance function to advance the seed for each range. So you can get reproducibility.