private static Random create()
{
// We initialize new Random objects using the next value from a global
// static shared random generator in order to avoid creating many random
// objects with the random seed. This guarantees reproducibility but does
// not compromise the effectiveness of parallel methods that depends on
// the generation of true random sequences with different values.
lock (sourceLock)
{
if (source == null)
return new Random(0);
return new Random(source.Next());
}
}