You are not logged in.
Pages: 1
Is there an alternative for this RTL random generator? It is not very fast or accurate.
An SSE optimized version would be nice but i cannot find any in SynCommons.pas
Offline
There is none in SynCommons.pas.
Up to now, we rely on Random() + GetTickCount for instance as RandomSeed().
It is enough for our purpose.
Then a hash (e.g. crc32 or SHA256) if real random is needed.
I suspect this implementation is pretty good and fast:
https://code.google.com/p/gpdelphiunits … domGen.pas
Offline
Random() is not thread safe at all. Because it is not a thread var. Plus 64 bit is a lot slower since its written in ASM.
Offline
You have to protect your call to Random(), or the code supplied at https://code.google.com/p/gpdelphiunits … domGen.pas with a critical section.
Offline
Is better to use threadvar IMHO. Locks are slower, much slower.
Offline
Pages: 1