Greetings. :)

Jeff Kesselman jeffk at
Tue Apr 8 20:47:08 New Zealand Standard Time 1997

At 01:44 PM 4/8/97 -0400, you wrote:
>On Apr 6,  8:23am, coder at wrote:
>[ stuff about JCL's DB snipped ] 
>> This is probably better understood from the inside oot, rather than trying
>> to look at the server side:
>>   Everything is an object.
>>   Objects are defined in a database.
>>   Objects have Unique IDs.
>I've been kicking this unique ID/object around as well, and was
>wondering about how you generate them?  I haven't been able to find
>any algorithms that would generate a unique ID given an object (or a
>request to do so) without having to search the list of ID's already
>generated.  I don't know for sure if that last bit is possible, but I
>want things to still be speedy when the number of objects is large
>(2^31).  I had an idea to keep track of the next available ID, and
>each time an object was created, assign it that value, then bump the
>value.  Whenever an object is destroyed, keep track of the last 'n'
>(where n is something fairly small and manageable like 100) now-free
>IDs and if you wrap your next-ID counter, pull them out of the list of
>freed IDs.  If the list runs empty, you have to search, though.
>There's optimization to be done in that, but that's the gist.
>Any magical algorithms? :)

Hmm.... cold does this integrally. I uspsect it just keeps an efficeintly
searched list. How abotu this....

A "highest allocetd" counter and a list of available (freed) numbers.
Yo uuse the first on the free list unless the lsit is empty in which case
you bump the "highest' number and use that?

Just some thoughts.


More information about the MUD-Dev mailing list