Title
May random_device block?
Status
nad
Section
[rand.device][tr.rand.device]
Submitter
Matt Austern

Created on 2006-01-10.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Adopt the proposed resolution in N2423 (NAD).

Date: 2010-10-21.18:28:33

[ Berlin: Walter: N1932 considers this NAD. Does the standard specify whether std::cin may block? ]

See N2391 and N2423 for some further discussion.

Date: 2006-01-10.00:00:00

Class random_device "produces non-deterministic random numbers", using some external source of entropy. In most real-world systems, the amount of available entropy is limited. Suppose that entropy has been exhausted. What is an implementation permitted to do? In particular, is it permitted to block indefinitely until more random bits are available, or is the implementation required to detect failure immediately? This is not an academic question. On Linux a straightforward implementation would read from /dev/random, and "When the entropy pool is empty, reads to /dev/random will block until additional environmental noise is gathered." Programmers need to know whether random_device is permitted to (or possibly even required to?) behave the same way.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3019
2010-10-21 18:28:33adminsetmessages: + msg3018
2006-01-10 00:00:00admincreate