[concurrency-interest] ThreadLocalRandom vs ThreadLocalSecureRandom ?

Holger Peine Holger.Peine at fh-hannover.de
Tue Feb 14 01:36:41 EST 2012


Am 14.02.2012 04:52, schrieb Hanson Char:
> Apparently ThreadLocalRandom is made available in Java 7 for concurrency
> reason:
> 
>   http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadLocalRandom.html
> 
> I wonder why there isn't a thread local equivalence for SecureRandom.

Just making a spontaneous guess here:  The reason could be that, while a
pseudo-random number generator such as is used with Random and
ThreaLocalRandom can easily be implemented on a per-thread basis since
it is pure software, that is not true for SecureRandom, since the latter
is based on a hardware entropy source (such as mouse movements, clock
drift etc.), and you cannot give every thread its own piece of entropy-
generating hardware.

Kind regards,
Holger Peine


-- 
Prof. Dr. Holger Peine
Hochschule Hannover, Fakultät IV, Abt. Informatik
Tel: +49(511)9296-1830  Fax: -1810 (shared, please state my name)
Ricklinger Stadtweg 120, D-30459 Hannover, Germany


More information about the Concurrency-interest mailing list