Various Random things (Was: Java 8 RFC 7189139: BigInteger's staticRandom field can be a source of bottlenecks)

Brian Burkhalter brian.burkhalter at
Thu Sep 5 19:38:13 UTC 2013

On Sep 5, 2013, at 7:50 AM, Paul Sandoz wrote:

>> The change to pass in the random number generator appears fine.
>> There's probably no need for a strong random number generator in this
>> case, though.
> If that is the case why not just leave the method as is and replace SecureRandom with ThreadLocalRandom?

I can't speak to the details of the random number generation or primality testing, but from my viewpoint the objective of the proposal was to provide an alternative which solves the "bottleneck" problem described in the issue report while at the same time ensuring consistency with previous JDK versions. If simply replacing SecureRandom with ThreadLocalRandom were acceptable to the PRNG cognoscenti then that would be preferable to me as well.


More information about the core-libs-dev mailing list