Boost has a bit more to say on random_device BoostQuoteClass random_device models a non-deterministic random number generator . It uses one or more implementation-defined stochastic processes to generate a sequence of uniformly distributed non-deterministic random numbers. For those environments where a non-deterministic random number generator is not available, class random_device must not be implemented. C++11QuoteNote that std::random_device may be implemented in terms of a pseudo-random number engine if a non-deterministic source (e.g. a hardware device) is not available to the implementation. Is there a problem here? From Boost RandomQuoteOn the Linux operating system, token is interpreted as a filesystem * path. It is assumed that this path denotes an operating system * pseudo-device which generates a stream of non-deterministic random * numbers. The pseudo-device should never signal an error or end-of-file. * Otherwise, @c std::ios_base::failure is thrown. By default, * \random_device uses the /dev/urandom pseudo-device to retrieve * the random numbers. Another option would be to specify the /dev/random * pseudo-device, which blocks on reads if the entropy pool has no more * random bits available. * * <b>Implementation Note for Windows</b> * * On the Windows operating system, token is interpreted as the name * of a cryptographic service provider. By default \random_device uses * MS_DEF_PROV. *Now I can understand a bit the slowness.
Last edited by Cuchulainn
on October 27th, 2014, 11:00 pm, edited 1 time in total.