[fpc-devel] Random thread-safe

Jonas Maebe jonas.maebe at elis.ugent.be
Thu Jan 28 15:39:57 CET 2016


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.


Jonas



More information about the fpc-devel mailing list