mirror of
https://github.com/python/cpython
synced 2024-09-06 02:18:37 +00:00
bpo-39108: Document threading issues for random.gauss() (GH-22928)
This commit is contained in:
parent
e6a7ea4f2e
commit
3cde3788b6
|
@ -319,6 +319,13 @@ be found in any statistics text.
|
|||
deviation. This is slightly faster than the :func:`normalvariate` function
|
||||
defined below.
|
||||
|
||||
Multithreading note: When two threads call this function
|
||||
simultaneously, it is possible that they will receive the
|
||||
same return value. This can be avoided in three ways.
|
||||
1) Have each thread use a different instance of the random
|
||||
number generator. 2) Put locks around all calls. 3) Use the
|
||||
slower, but thread-safe :func:`normalvariate` function instead.
|
||||
|
||||
|
||||
.. function:: lognormvariate(mu, sigma)
|
||||
|
||||
|
|
Loading…
Reference in a new issue