Class ThreadsafeXorShiftRandom


  • public class ThreadsafeXorShiftRandom
    extends XorShiftRandom
    A threadsafe implementation of XorShiftRandom. We use a ThreadLocal to give each thread it's own implementation.
    • Constructor Detail

      • ThreadsafeXorShiftRandom

        public ThreadsafeXorShiftRandom()
    • Method Detail

      • random

        public long random()
        We use the random generator for this very thread. This method is perfectly threadsafe. It is also guaranteed that each thread will get own values.
        Overrides:
        random in class XorShiftRandom
        Returns: