hunt.concurrency.ThreadLocalRandom

Undocumented in source.

Members

Classes

ThreadLocalRandom
class ThreadLocalRandom

A random number generator isolated to the current thread. Like the global {@link java.util.Random} generator used by the {@link java.lang.Math} class, a {@code ThreadLocalRandom} is initialized with an internally generated seed that may not otherwise be modified. When applicable, use of {@code ThreadLocalRandom} rather than shared {@code Random} objects in concurrent programs will typically encounter much less overhead and contention. Use of {@code ThreadLocalRandom} is particularly appropriate when multiple tasks (for example, each a {@link ForkJoinTask}) use random numbers in parallel in thread pools.

Meta