Re: weak random ?
From: Steve McLellan (sjm_at_fixerlabs.com.NOSPAM)
Date: 03/04/04
- Next message: Josema: "Security exception permission denied"
- Previous message: Morten Wennevik: "Re: weak random ?"
- In reply to: Arild Bakken: "Re: weak random ?"
- Next in thread: Morten Wennevik: "Re: weak random ?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 4 Mar 2004 11:50:51 -0000
Even given that, we noticed a distinct pattern in random when we were using
it, and ended up calling it 6 or 7 times just to kick start it into some
degree of unpredictability. If you actually need a proper random number
generator (for encryption etc, where it could matter) you might check out
the Boost libraries - they have some good stuff.
Steve
"Arild Bakken" <arildb_@hotmail.com> wrote in message
news:%23ak1Z4dAEHA.4080@TK2MSFTNGP09.phx.gbl...
> Well from the docs:
>
> Random rand = new Random();
> Initializes a new instance of the Random class, using a time-dependent
> default seed value.
>
> If two threads are running simultaneously and executes this call with only
> microseconds in time difference, you will definately get the same random
> sequence.
>
> Make sure there is a delay between the instantiation of the calls for the
> two threads and you should be fine.
>
>
> Arild
>
>
> <user@domain.invalid> wrote in message
> news:uG%23dqvdAEHA.2348@TK2MSFTNGP09.phx.gbl...
> > Hello
> > i call it in almost same time (from two different threads):
> > Random rand = new Random();
> > id=rand.Next(65535);
> >
> > and i often receive the same results.
> > Is it possible ? How windows count this random ?
> >
> >
> > Thanx
> >
>
>
- Next message: Josema: "Security exception permission denied"
- Previous message: Morten Wennevik: "Re: weak random ?"
- In reply to: Arild Bakken: "Re: weak random ?"
- Next in thread: Morten Wennevik: "Re: weak random ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|