Re: [concurrency-interest] ThreadLocalRandom.nextSecondarySeed() re-initializes TLR's seed

2014-06-20 Thread Peter Levart
Hi Doug, On 06/19/2014 02:02 PM, Doug Lea wrote: On 06/19/2014 04:48 AM, Peter Levart wrote: Or, even better, why not just using the next value from the "seeder" sequence for the initial value of "secondary" seed and avoid interaction with TLR's main seed/probe: Thanks! Or better, just use

Re: [concurrency-interest] ThreadLocalRandom.nextSecondarySeed() re-initializes TLR's seed

2014-06-19 Thread Doug Lea
On 06/19/2014 04:48 AM, Peter Levart wrote: Or, even better, why not just using the next value from the "seeder" sequence for the initial value of "secondary" seed and avoid interaction with TLR's main seed/probe: Thanks! Or better, just use mix32: +if ((r = (int)mix64(seeder.get

Re: ThreadLocalRandom.nextSecondarySeed() re-initializes TLR's seed

2014-06-19 Thread Peter Levart
Or, even better, why not just using the next value from the "seeder" sequence for the initial value of "secondary" seed and avoid interaction with TLR's main seed/probe: diff -r 5b45a5efe417 src/share/classes/java/util/concurrent/ThreadLocalRandom.java --- a/src/share/classes/java/util/concur

ThreadLocalRandom.nextSecondarySeed() re-initializes TLR's seed

2014-06-19 Thread Peter Levart
Hi, I noticed an inconsistency in calling TLR.localInit() method. Everywhere it's called conditionaly if thread-local "probe" is zero except in TLR.nextSecondarySeed() where it's called if "secondary" seed is zero. This re-initializes the "probe" and "seed" even though they might have already