rayon-rs / rayon

Rayon: A data parallelism library for Rust
Apache License 2.0
11.02k stars 501 forks source link

Add a parallelizable PRNG #136

Open edre opened 7 years ago

edre commented 7 years ago

It would be simple to write a seedable PRNG as a rayon Producer, at least with LCGs that support efficient skipping. Any user that does not care about determinism should probably stick with rand::thread_rng, which shouldn't have any concurrency bottlenecks.

A basic implementation would only emit u32s, but users may want other types or distributions, and incorporating those into the API would be more complicated.

svenstaro commented 6 years ago

Isn't this done as of #571?

edre commented 6 years ago

This issue is about a deterministic random Producer, which is different from the internal non-deterministic rng from #571.

svenstaro commented 6 years ago

You're right, I misread at first.