阅读背景:

每个线程的ThreadLocalRandom或new Random

来源:互联网 

Is there any difference when I create in each thread new java.util.Random object or use the ThreadLocalRandom.current().nextInt(3); ? From what I've read, ThreadLocalRandom should be used instead of using the same instance of java.util.Random for all threads but what if a create a new instance for each thread?Is there any difference when I create in each t




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: