RE: Separate threads of random numbers
- Posted by Rod Jackson <rodjackson_x at hotmail.com> Apr 10, 2002
- 387 views
Andy Serpa wrote: > > > Looks good, but will this avoid any algorithmic pitfalls? I.e., > > one thread in 100 finds a quirk in the psuedorandom algorithm > > and continually brings up the same number over and over? Stuff > > like that can be a headache.... > > > > That's the sort of thing I need to avoid, and is the reason for > separating the threads. Under the proposed system, how would the same > number keep repeated itself? Could you detail the possible "chain" that > > worries you? Well, just off the top of my head... Thread #5 might have a unique, "problematic" seed value to start out. This seed value will generate a random number like usual, and of course the next number could then be used as the new seed. This new seed will then generate a new random number, but then the next number is the same as the ORIGINAL seed value. That number then replaces the new seed, so in essence the seed just keeps switching between two numbers. You ask for 100 random numbers in a row from the thread, and you get a repeating pattern of two integers. Or it might take three, or more steps for the repetition to occur... Granted, this might not be feasible; the likelihood of recurring numbers may be no more than that of using the pseudorandom generator *without* seeding. It was something that popped up in my head. Rod