On Mon, 15 Oct 2001, Dom Lachowicz wrote:

> Quoting Mike Nordell <[EMAIL PROTECTED]>:
> 
> 
> > I agree with Hub here. If we are to get unique numbers used as IDs for
> > something, anything, why not use an incrementing ID? Random numbers
> > (even
> > that this is no RNG, it's like most implementations a PRNG) are used for
> > quite different purposes. We don't really _need_ random numbers, do we?
> > Isn't what we actually need unique IDs, or?
> 
> Seriously... We don't need random numbers here, just unique ones. Here's my 
> proposed replacement, which is also a helluva lot faster than any known good 
> random number generator:
> 
> UT_uint32 UT_newNumber ()
> {
>   static UT_uint32 theNum = 0;
>   //MUTEX_PROTECT this variable someday soon
>   return theNum++;
> }
> 
> Anyone opposed to me checking this into ut_math?
> 

I want to reserve the first 10000 ID's for future use with lists. BTW the
RTF SPEC DOES ask for random 32 bit ID's for some purposes. I forget
which right now though.

Cheers

Martin



Reply via email to