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
fastnoise_source uses non thread-safe rand() function #1542
Labels
Comments
marcusmueller
added a commit
to marcusmueller/gnuradio
that referenced
this issue
Jan 27, 2018
Closes gnuradio#1542. Also, replaces the pool generation based on gr::random by RV generated by the same XOROSHIRO128+ RNG used to calculate the random pool indices. If it's good enough, it's good enough – and all statistical tests I can come up with so far say it is good enough.
marcusmueller
added a commit
to marcusmueller/gnuradio
that referenced
this issue
Jan 27, 2018
Closes gnuradio#1542. Also, replaces the pool generation based on gr::random by RV generated by the same XOROSHIRO128+ RNG used to calculate the random pool indices. If it's good enough, it's good enough – and all statistical tests I can come up with so far say it is good enough.
marcusmueller
added a commit
to marcusmueller/gnuradio
that referenced
this issue
Feb 16, 2018
This solves the issue with libc rand() relying on global (not thread-local!) state and thus not being suited for multithreaded applications. This fixes gnuradio#1542.
marcusmueller
added a commit
that referenced
this issue
Mar 4, 2018
This solves the issue with libc rand() relying on global (not thread-local!) state and thus not being suited for multithreaded applications. This fixes #1542.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The fast noise source block uses the rand() function to sample the precalculated values.
As rand() is not thread safe, this leads to non-reproducible behaviour.
Also, the specified seed value is not used with srand.
It might be better to use the random number functions in boost or in C++11.
To easily show this behaviour, connect two fast noise sources with the same seed to a subtract block and plot the output.
The text was updated successfully, but these errors were encountered: