default random object?

Walter Bright newshound1 at digitalmars.com
Sat Feb 14 03:02:14 PST 2009


Andrei Alexandrescu wrote:
> 2. The global random generator will be allocated per thread. Are you 
> cool with this too?

That could have speed problems with a tight loop accessing thread local 
storage. If it's a shared global with no locking, the thread randomness 
will increase its randomness <g>.


> 3. How should the global rng be initialized? To always generate the same 
> sequence, or not?

Always different, because that's what I want if I just want a freakin' 
random number!



More information about the Digitalmars-d mailing list