Looks like we can use rand_int in ldpc/rand.cLong time since I was worried 
about random numbers....I remember now that rand() was horrible.

de Mike W9MDB


   

   From: Bill Somerville <g4...@classdesign.com>
 To: wsjt-devel@lists.sourceforge.net 
 Sent: Friday, November 11, 2016 10:28 AM
 Subject: Re: [wsjt-devel] r7303 error?
  
 On 11/11/2016 16:05, Black Michael wrote:
  
 Looks like the rand_s was done for "thread safe" use as there's an older 
version in normrnd.c that uses rand().  But rand_s() is not any more threadsafe 
than rand() for Windows.  rand_s is "secure". 
  rand() is thread safe in the VC runtime since static variables are placed on 
TLS.
  
  http://stackoverflow.com/questions/143108/is-windows-rand-s-thread-safe#143119
  
  So....this patch just changes windows to use rand() again. 
 Hi Mike, the reason for not using the CRT rand() function is not because of 
thread safety. rand() is a very poor PRNG, mainly because it has a small range 
in some implementations e.g. 32k in MS's implementation. Our decoding 
algorithms need good quality PRNGs for best performance. If you want he whole 
horror story watch to STL's presentation here: 
https://channel9.msdn.com/Events/GoingNative/2013/rand-Considered-Harmful the 
second half is mostly about how C++11 improves matters with the <random> 
library but the intro tell the story on what is wrong with rand(). Switching to 
rand() would be "Throwing the baby out with the bath water". 73
 Bill
 G4WJS.
  
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
wsjt-devel mailing list
wsjt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wsjt-devel


   
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
wsjt-devel mailing list
wsjt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wsjt-devel

Reply via email to