diff options
author | Devin Jeanpierre <jeanpierreda@google.com> | 2016-02-22 08:00:42 -0800 |
---|---|---|
committer | Devin Jeanpierre <jeanpierreda@google.com> | 2016-02-22 08:00:42 -0800 |
commit | 9cdff27107b5feb0f6bfe5c408970716b19aa93d (patch) | |
tree | c162935e5b1157f1d45a0728f86fdde49ad27231 /numpy/doc/byteswapping.py | |
parent | e5c1ac175722bc58e74aac4e6d9138adf9260ec6 (diff) | |
download | numpy-9cdff27107b5feb0f6bfe5c408970716b19aa93d.tar.gz |
BUG: Remove data race in mtrand: two threads could mutate the state.
E.g.:
np.random.random_sample() uses the GIL for synchronization
np.random.random_sample(1) releases the GIL and uses a separate lock.
This means that both can run simultaneously, causing a data race when mutating
the random number generator's state, which could lead to buffer overflow (from
incrementing state->pos).
The fix here is to always use the separate lock, so that exactly one thread at
a time is mutating the random number generator's state.
Diffstat (limited to 'numpy/doc/byteswapping.py')
0 files changed, 0 insertions, 0 deletions