[fpc-devel] Random thread-safe

Michael Van Canneyt michael at freepascal.org
Thu Jan 28 15:43:02 CET 2016

On Thu, 28 Jan 2016, Jonas Maebe wrote:

> thaddy wrote on Thu, 28 Jan 2016:
>> Then wouldn't it be possible to make PRNG's  plugable. The Mersenne twister 
>> is still good as it is but definitely not suitable for every and any case. 
>> Marsialigla's might be a better choice nowadays.
>> And the seeding can nowadays often been done from reading hardware random, 
>> like on the Raspberry Pi.
>> e.g. 
>> http://scruss.com/blog/2013/06/07/well-that-was-unexpected-the-raspberry-pis-hardware-random-number-generator/
> The random number generator is just there as a general purpose tool, for 
> TP/Delphi functional compatibility (not implementation compatibility, as we 
> use a different PRNG). Unlike functionality such as the memory manager and 
> code page conversions, it is not used by other parts of the language or RTL. 
> As a result, there is no need to complicate the system unit by implementing a 
> complete plugin infrastructure for this.

You can just write and use your own random number mechanism if this is so
important. read /dev/urandom or so...


More information about the fpc-devel mailing list