On 11 Feb 2014, at 17:15, Thiago Macieira <[email protected]> wrote:
> Em ter 11 fev 2014, às 09:04:39, Konrad Rosenbaum escreveu: >> Please don't go there. AFAIK qrand() is a function meant to be equivalent to >> the ANSI-C rand() function. I.e. it is supposed to be used by simple >> simulations, be fast and produce reproducable random numbers when seeded >> with the same value. > > Fast? yes. > > Needs to produce reproduceable sequence? Yes, but only because of unit > testing. > > Equal to rand()? I'm not sure we need to keep that. > > My idea was to simply securely pre-seed the PRNG before you had a chance to > use it, in each thread. If you need to seed it to something constant to get > constant results, you'd still be able to. Or you could keep the qsrand() method. When qsrand() is not called qrand() produces the same sequence. As part of the QtWebSockets module, I created a random generator that is fast and that has reproducible sequences. But it is based on std::random only. Code will be checked in soon. I will add you to the reviewers. Cheers, Kurt > -- > Thiago Macieira - thiago.macieira (AT) intel.com > Software Architect - Intel Open Source Technology Center > > _______________________________________________ > Development mailing list > [email protected] > http://lists.qt-project.org/mailman/listinfo/development _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
