[concurrency-interest] ThreadLocalRandom initial seed

Chris Hegarty chris.hegarty at oracle.com
Tue Oct 4 10:28:15 EDT 2011


On 10/ 4/11 03:02 PM, Kasper Nielsen wrote:
> On 06-06-2011 22:27, Martin Buchholz wrote:
>> On Fri, Jun 3, 2011 at 14:35, Martin Buchholz<martinrb at google.com> wrote:
>>
>> jsr166 CVS now has a fixed version of Random.java that causes
>> ThreadLocalRandom to work correctly.
>
> Was java 7 shipped without the fix?

Yes, JDK7 shipped with this issue. It has been fixed in JDK8 [1] and 7u2 
[2]. You will need to get the latest 7u2 pre-release binary.

-Chris.

[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7051516
[2] http://bugs.sun.com/view_bug.do?bug_id=2210683

>
> I´m doing
> public static void main(String[] args) {
> System.out.println(ThreadLocalRandom.current().nextInt());
> }
> and getting a 0 everytime
>
> cheers
> Kasper
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest


More information about the Concurrency-interest mailing list