José,
Doh! yes wrapping Random in a thread safe class would be a good idea!
--
Hope this helps
Jay B. Harlow [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"José Manuel Agüero" <chema012_hotmail.com> wrote in message
news:Oy**************@TK2MSFTNGP02.phx.gbl...
Hello D. Patrick,
The best approach using the Random class might be to create a class that
holds a single Random instance and offers a shared, thread safe, property
that returns a random number. Your threads would get the random number
through this property.
Regards.
"D. Patrick" <re*****************@thenotreal.com> escribió en el mensaje
news:4c*****************@tornado.socal.rr.com...
|I have a multi-threaded app that needs to generate random 8 digit numbers.
| I'm using VB.NET 2.0. The problem is that >1 request for a random number
| can occur in the same millisecond. I can't seed with a time value when
the
| time for 2 (or more) threads is identical. Even ticks is identical. So
| how can I generate a random number that will not likely be the same as the
| number returned by another thread running at that same millisecond? It
| seems computers are getting too fast these days to just seed with the
time.