Skip to content
  • W. David Dagenhart's avatar
    Improve thread safety in the Random package · 0873ffe7
    W. David Dagenhart authored
    There are three different changes to static
    and global variables. Where possible they are
    made const. Variables used to generate default
    seeds are made atomic so different threads will
    get different seeds. Others are made thread local.
    The only exceptions are ones in single thread
    tests that are left as is. I also left the ones
    in the classes that use rand and drand48 as is
    because those classes are inherently thread unsafe
    for other reasons.
    0873ffe7