10000 bpo-39108: Document threading issues for random.gauss() by rhettinger · Pull Request #22928 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-39108: Document threading issues for random.gauss() #22928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Doc/library/random.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
4B62 slower, but thread-safe :func:`normalvariate` function instead.


.. function:: lognormvariate(mu, sigma)

Expand Down
0