It's not just that, but randseed is not a threadvar. This means that
all your threads use the same randseed variable, so if two threads
call "random" at the same time they will still get the same "random"
number.


Jonas
And also generating a rand * getpid you can't really get good random numbers. I just made a withdrawal program on this idea, so I've got several repetitions, and upon executing a program again and agian I've got false random numbers, like: a*n; a*(n+1); a*(n+2).
That's not a solution anyway.

Maybe a bit shifting or some aritmetical function can help to obtain a more random "looking" number.

I'm trying my next random number generation to filter it with the sin() function, so I can get a bit more entropy :)
(I can't use atmospheric noise as some suggested)
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to