ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166y/ThreadLocalRandom.java
(Generate patch)

Comparing jsr166/src/jsr166y/ThreadLocalRandom.java (file contents):
Revision 1.10 by jsr166, Sat Jul 25 00:34:00 2009 UTC vs.
Revision 1.11 by dl, Fri Jul 31 16:25:20 2009 UTC

# Line 9 | Line 9 | package jsr166y;
9   import java.util.Random;
10  
11   /**
12 < * A random number generator with the same properties as class {@link
13 < * Random} but isolated to the current Thread.  Like the global
14 < * generator used by the {@link java.lang.Math} class, a
15 < * ThreadLocalRandom is initialized with an internally generated seed
16 < * that may not otherwise be modified. When applicable, use of
17 < * ThreadLocalRandom rather than shared Random objects in concurrent
18 < * programs will typically encounter much less overhead and
19 < * contention.  ThreadLocalRandoms are particularly appropriate when
20 < * multiple tasks (for example, each a {@link ForkJoinTask}), use
21 < * random numbers in parallel in thread pools.
12 > * A random number generator isolated to the current Thread.  Like the
13 > * global {@link java.util.Random} generator used by the {@link
14 > * java.lang.Math} class, a ThreadLocalRandom is initialized with an
15 > * internally generated seed that may not otherwise be modified. When
16 > * applicable, use of ThreadLocalRandom rather than shared Random
17 > * objects in concurrent programs will typically encounter much less
18 > * overhead and contention.  ThreadLocalRandoms are particularly
19 > * appropriate when multiple tasks (for example, each a {@link
20 > * ForkJoinTask}), use random numbers in parallel in thread pools.
21   *
22   * <p>Usages of this class should typically be of the form:
23   * {@code ThreadLocalRandom.current().nextX(...)} (where

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines