On Fri, Mar 26, 2010 at 9:55 AM, Chas Emerick <[email protected]> wrote: > Hi Lee, > > Indeed -- from the docs for Math.random(): > > "This method is properly synchronized to allow correct use by more than one > thread. However, if many threads need to generate pseudorandom numbers at a > great rate, it may reduce contention for each thread to have its own > pseudorandom-number generator." > > At its root, java.util.Random uses an AtomicLong to store the last dispensed > pseduorandom number
Nitpick: The state of a production-quality PRNG is never the last number it generated. That would mean you could initialize your own instance of the algorithm with the last number you saw it output and immediately duplicate all its future output. -Per -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en To unsubscribe from this group, send email to clojure+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
