You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To develop a drop-in replacement for rand::thread_rng() that works around #1357 by using a buffering wrapper around OsRng where the buffer is a channel shared across all threads.
What type of application is this? (E.g. cryptography, game, numerical simulation)
A library intended for multithreaded Monte Carlo simulations.
This is not future-proof against any change to the default algorithm, the reseeding threshold, or the use of Rc<UnsafeCell<_>>. It would be better if there was a method that would construct a ThreadRng given reseeder as the only parameter, and otherwise promise to have the same implementation details as thread_rng().
The text was updated successfully, but these errors were encountered:
Background
What is your motivation?
To develop a drop-in replacement for
rand::thread_rng()
that works around #1357 by using a buffering wrapper around OsRng where the buffer is a channel shared across all threads.What type of application is this? (E.g. cryptography, game, numerical simulation)
A library intended for multithreaded Monte Carlo simulations.
Feature request
At https://github.com/Pr0methean/shared_buffer_rng/blob/85cf1caf6ffbb7018ff6d4464f4fc7b07d34b3d6/src/lib.rs#L110, to create an otherwise-identical drop-in replacement for
rand::thread_rng()
that was to differ only in how it obtained seeds, I had to copy many of ThreadRng's implementation details:This is not future-proof against any change to the default algorithm, the reseeding threshold, or the use of
Rc<UnsafeCell<_>>
. It would be better if there was a method that would construct aThreadRng
givenreseeder
as the only parameter, and otherwise promise to have the same implementation details asthread_rng()
.The text was updated successfully, but these errors were encountered: