diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/support/rand.c')
-rw-r--r-- | src/third_party/wiredtiger/src/support/rand.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/third_party/wiredtiger/src/support/rand.c b/src/third_party/wiredtiger/src/support/rand.c index 264ee711755..fcc76147f7e 100644 --- a/src/third_party/wiredtiger/src/support/rand.c +++ b/src/third_party/wiredtiger/src/support/rand.c @@ -29,16 +29,15 @@ #include "wt_internal.h" /* - * This is an implementation of George Marsaglia's multiply-with-carry pseudo- - * random number generator. Computationally fast, with reasonable randomness - * properties, and a claimed period of > 2^60. + * This is an implementation of George Marsaglia's multiply-with-carry pseudo- random number + * generator. Computationally fast, with reasonable randomness properties, and a claimed period of > + * 2^60. * - * Be very careful about races here. Multiple threads can call __wt_random - * concurrently, and it is okay if those concurrent calls get the same return - * value. What is *not* okay is if reading/writing the shared state races and - * uses two different values for m_w or m_z. That can result in a stored value - * of zero, in which case they will be stuck on zero forever. Take a local copy - * of the values to avoid that, and read/write in atomic, 8B chunks. + * Be very careful about races here. Multiple threads can call __wt_random concurrently, and it is + * okay if those concurrent calls get the same return value. What is *not* okay is if + * reading/writing the shared state races and uses two different values for m_w or m_z. That can + * result in a stored value of zero, in which case they will be stuck on zero forever. Take a local + * copy of the values to avoid that, and read/write in atomic, 8B chunks. */ #undef M_W #define M_W(r) r.x.w |