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

Comparing jsr166/src/main/java/util/Random.java (file contents):
Revision 1.24 by jsr166, Wed Jul 22 00:00:54 2009 UTC vs.
Revision 1.25 by jsr166, Wed Aug 5 01:34:23 2009 UTC

# Line 50 | Line 50 | import sun.misc.Unsafe;
50   * <p>
51   * Many applications will find the method {@link Math#random} simpler to use.
52   *
53 + * <p>Instances of {@code java.util.Random} are threadsafe.
54 + * However, the concurrent use of the same {@code java.util.Random}
55 + * instance across threads may encounter contention and consequent
56 + * poor performance. Consider instead using
57 + * {@link java.util.concurrent.ThreadLocalRandom} in multithreaded
58 + * designs.
59 + *
60 + * <p>Instances of {@code java.util.Random} are not cryptographically
61 + * secure.  Consider instead using {@link java.security.SecureRandom} to
62 + * get a cryptographically secure pseudo-random number generator for use
63 + * by security-sensitive applications.
64 + *
65   * @author  Frank Yellin
66   * @since   1.0
67   */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines