I have a loop in my code
Parallel.For(0, Cnts.MosqPopulation, i => { DoWork() });
however in the DoWork() function, there a
If you have knowledge of how many threads you are running in parallel this may work:
Random rand = new Random();
var randomNums = Enumerable.Range(0, Cnts.MosqPopulation)
.Select(_ => rand.Next()).ToList();
Parallel.For(0, Cnts.MosqPopulation, i =>
{
Random localRand = new Random(randomNums[i]);
DoWork();
});
Not sure how indistinguishable the resulting distribution would be from a uniform one though.