Hi Bill, > On Jul 12, 2015, at 10:36 AM, Bill Somerville <g4...@classdesign.com> wrote: > > On 12/07/2015 02:12, Steven Franke wrote: > > Hi Steve, > > ... >> - moved random seed initialization to WSPRBandHopping.cpp as recommended by >> W9MDB. This should address the synchronized-transmissions issue reported by >> Jean Louis. > I have re-factored this change by moving the pseudo RNG seeding to > before main() is called which makes it more suitable for a C++ > application. I have also used the Qt qsrand() as that is more portable > and is thread safe. It also effectively seeds for rand() but I have > switched to using qrand() where possible as that too is thread safe. Thanks. >> >> Comments and suggestions welcome! > I see that wsprd makes use of rand() but doesn't appear to seed the > pseudo RNG. This is somewhat tricky since the normal way the wsprd is > started is on a timer and using the usual srand(time(NULL)) will not > necessarily be valid across a global network of time synchronized > computers. I am not a fan of spawning a process to do what is > essentially a simple procedure call so I will leave this to you to find > a way to seed the PRNG for wsprd. Perhaps srand(getpid()) might be better.
It is still pre-coffee here, so forgive me if I’m missing the point — but I believe that the only use of rand() associated with wsprd would be in wsprsim.c where rand is used to generate noise when producing a .c2 file containing a (simulated) noisy signal. I will address this, but I don’t think that it comes into play for wsjt-x users, since wsprsim is a “utility” program used for development purposes. Or were you referring to my use of rand() in WsprTxScheduler? Should rand() be replaced with qrand() in WsprTxScheduler.cpp? >> >> Steve k9an > 73 > Bill > G4WJS. > > ------------------------------------------------------------------------------ > Don't Limit Your Business. Reach for the Cloud. > GigeNET's Cloud Solutions provide you with the tools and support that > you need to offload your IT needs and focus on growing your business. > Configured For All Businesses. Start Your Cloud Today. > https://www.gigenetcloud.com/ > _______________________________________________ > wsjt-devel mailing list > wsjt-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wsjt-devel ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ wsjt-devel mailing list wsjt-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wsjt-devel