a2d196e75c
It's not difficult for multiple threads to drain the entropy available to the RDSEED instruction, at which point we throw an exception. This change will try to use RDRAND after RDSEED fails repeatedly, and only throw if RDRAND also fails repeatedly. This doesn't guarantee a random value can always be read, but reduces the likelihood of failure when using the RDSEED instruction. PR libstdc++/94087 * src/c++11/random.cc (__x86_rdseed): Allow fallback function to be passed in. (__x86_rdseed_rdrand): New function that uses rdseed with rdrand fallback. (random_device::_M_init): Use __x86_rdseed_rdrand when both instructions are available. * testsuite/26_numerics/random/random_device/94087.cc: New test. |
||
---|---|---|
.. | ||
config | ||
doc | ||
include | ||
libsupc++ | ||
po | ||
python | ||
scripts | ||
src | ||
testsuite | ||
ChangeLog | ||
ChangeLog-1998 | ||
ChangeLog-1999 | ||
ChangeLog-2000 | ||
ChangeLog-2001 | ||
ChangeLog-2002 | ||
ChangeLog-2003 | ||
ChangeLog-2004 | ||
ChangeLog-2005 | ||
ChangeLog-2006 | ||
ChangeLog-2007 | ||
ChangeLog-2008 | ||
ChangeLog-2009 | ||
ChangeLog-2010 | ||
ChangeLog-2011 | ||
ChangeLog-2012 | ||
ChangeLog-2013 | ||
ChangeLog-2014 | ||
ChangeLog-2015 | ||
ChangeLog-2016 | ||
ChangeLog-2017 | ||
ChangeLog-2018 | ||
ChangeLog-2019 | ||
Makefile.am | ||
Makefile.in | ||
README | ||
acinclude.m4 | ||
aclocal.m4 | ||
config.h.in | ||
configure | ||
configure.ac | ||
configure.host | ||
crossconfig.m4 | ||
fragment.am | ||
linkage.m4 |
README
file: libstdc++-v3/README New users may wish to point their web browsers to the file index.html in the 'doc/html' subdirectory. It contains brief building instructions and notes on how to configure the library in interesting ways.