-
Notifications
You must be signed in to change notification settings - Fork 8
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
Rethink storage of the RNG #63
Comments
According to the discussion on rcpp-devel, a |
FWIW I use The only thing to note is that anyone saving their R session will invalidate the external pointer (obviously). It seems that invalidation yields a NULL pointer so you can check for that and re-init the pointer when necessary, e.g., here. |
In PR #58 it was discussed if it makes sense to change the way the RNG is stored within dqrng.
dqrng::rng64_t == std::shared_pointer<dqrng::random_64bit_generator>
wheredqrng::random_64bit_wrapper<RNG>
provides the actual storage.std:unique_ptr
might make more sense.Rcpp::XPtr
would simplify the code for sharing the RNG externally. It would make sense the assert the life cycles ofXPtr
objects are copy-construction on rcpp-devel, c.f. feat: global RNG access #58 (comment).The text was updated successfully, but these errors were encountered: