devurmel / morelinq

Automatically exported from code.google.com/p/morelinq
Apache License 2.0
0 stars 0 forks source link

Better seeding for Random #65

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently it creates its randomness source using the default constructor of the 
Random class. But the well known problem with that is that this is seeded with 
the system time, which typically doesn't change for 16ms. So all instances of 
the random class created during that interval will return the same sequence.

My suggestion is creating one static instance of random and using it(with 
locking of course) to create the seed for the individual instances of Random.

Original issue reported on code.google.com by CodeInCh...@quantentunnel.de on 2 Mar 2011 at 9:07