Hi,<br>Is it not a bit harsh to overwrite the "parent" state of this variable with something that never generates random numbers? I mean; say -- security etc.?<br><br>I mean, we start with making sure RANDOM is a bit more RANDOM than usual:<br>
<br><br><div style="margin-left: 40px;">;; Make RANDOM, well, random.<br>(setf *random-state*<br> (make-random-state t))<br></div><br><br>..and we trust this will stay so, even for threads -- based on the 3 points mentioned here:<br>
<div style="margin-left: 40px;"><a href="http://www.sbcl.org/manual/Special-Variables.html#Special-Variables">http://www.sbcl.org/manual/Special-Variables.html#Special-Variables</a> <br></div><br>..especially the first point, but then we end up with:<br>
<br><div style="margin-left: 40px;">SW> (bt:make-thread (lambda () (format t "~A~%" (random 1000))))<br>464<br>#<SB-THREAD:THREAD FINISHED values: NIL {BBB2001}><br>SW> (bt:make-thread (lambda () (format t "~A~%" (random 1000))))<br>
464<br>#<SB-THREAD:THREAD FINISHED values: NIL {BC487D1}><br></div><br><br>..and we have cross-session security problems and what not pop up... :(<br><br>(..i know it is a pseudo random generator, but it is "good enough" for my uses when set to T and combined with something from /dev/random from time to time..)<br clear="all">
<br>-- <br>Lars Rune Nøstdal<br><a href="http://nostdal.org/">http://nostdal.org/</a><br>