On 2/12/24 08:30, Linux-Fan wrote:
David Christensen writes:
On 2/11/24 02:26, Linux-Fan wrote:
I wrote a program to automatically generate random bytes in multiple
threads:
https://masysma.net/32/big4.xhtml
What algorithm did you implement?
I copied the algorithm from here:
https://www.javamex.com/tutorials/random_numbers/numerical_recipes.shtml
That Java code uses locks, which implies it uses global state and cannot
be run multi-threaded (?). (E.g. one process with one JVM.)
Is it possible to obtain parallel operation on an SMP machine with
multiple virtual processors? (Other than multiple OS processes with one
PRNG on one JVM each?)
I found it during the development of another application where I needed
a lot of random data for simulation purposes :)
My implementation code is here:
https://github.com/m7a/bo-big/blob/master/latest/Big4.java
If I were to do it again today, I'd probably switch to any of these PRNGS:
* https://burtleburtle.net/bob/rand/smallprng.html
* https://www.pcg-random.org/
Hard core. I'll let the experts figure it out; and then I will use
their libraries and programs.
David