Greetings. :)

Shawn Halpenny rsh at dos.nortel.com
Thu Apr 10 11:45:28 New Zealand Standard Time 1997


On Apr 9, 11:12pm, Jeff Kesselman wrote:
> Subject: Re: Greetings. :)
> At 10:08 AM 4/9/97 -0400, you wrote:
>
> >That almost seems too easy and I can't help but think I've missed
> >something...
>
> Well, it seems a touch fragile in that it depnds on an external setting
> 9the clock0 to always be reasonably correct and unique....
>
> What about daylight savings tiem in the fall, when the clock gets set back?

Daylight Savings Time is a pain in the ass no matter what you're dealing
with, but you can always adjust the time value used be the correct amount in
order to factor it out.

>
> Also what if the system clock jus rtgets fouled thorugh hardware or
> software failure?

That's why I'd always save the most-recently-used ID.  I can check each
generated ID against the most-recent ID and if the generated one is less
than the most-recent, then there was something screwy (since time will only
be moving forward in my world).  At that time, I suppose the system clock
could be re-set or I could temporarily adopt a different scheme
(incrementing subsequent IDs by one) until things were useable again.

I suppose that running out of IDs when I hit the 2^64-1th ID will cause me
to then adopt a new scheme, but creating over 18 quintillion objects over
the life of my mud will take a very long time, so perhaps the
increment-by-one solution will work anyway (the number of bits used to
store each ID is fixed, but there's nothing computationally intensive done
with them, so it doesn't hurt to make them "big").  Even if I then created
objects at the rate of 1 per microsecond, I'd have almost 585 thousand
years before my IDs wrapped.

>
> This scheme (dates) is good for short term thing like temp ids or random
> seeds but ild be scared to use it long term.
>
> JK

--
Shawn Halpenny



More information about the MUD-Dev mailing list