Scaling problem of HashMap (introduced with alternative hashing)

Aleksey Shipilev aleksey.shipilev at
Thu Dec 27 19:38:49 UTC 2012

Looks very like dumb inlined java.util.Random?
Is there a security threat to use ThreadLocalRandom instead there?


On 27.12.2012, at 23:16, Zhong Yu <zhong.j.yu at> wrote:

> Reported by the SO question
> the HashMap constructor contains a CAS, which is kind of surprising.
> Could it be removed?
>    transient final int hashSeed =
> sun.misc.Hashing.randomHashSeed(this);  // CAS
> Zhong Yu

More information about the core-libs-dev mailing list