ri > Concurrent::ThreadSafe::Util::XorShiftRandom

= Concurrent::ThreadSafe::Util::XorShiftRandom

(from /home/chedong/.local/share/rdoc)
------------------------------------------------------------------------
A xorshift random number (positive +Fixnum+s) generator, provides
reasonably cheap way to generate thread local random numbers without
contending for the global Kernel.rand.

Usage:
  x = XorShiftRandom.get # uses Kernel.rand to generate an initial seed
  while true
    if (x = XorShiftRandom.xorshift).odd? # thread-localy generate a next random number
      do_something_at_random
    end
  end
------------------------------------------------------------------------
= Constants:

MAX_XOR_SHIFTABLE_INT:
  [not documented]


= Instance methods:

  get
  xorshift

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-29 14:36 @216.73.217.111
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!