Unique id's

coder at ibm.net coder at ibm.net
Sun Apr 13 09:16:01 New Zealand Standard Time 1997

On 12/04/97 at 12:55 PM, "Jon A. Lambert" <jlsysinc at ix.netcom.com> said:
>> From: coder at ibm.net
>> On 12/04/97 at 12:51 AM, "Jon A. Lambert" <jlsysinc at ix.netcom.com> said:

>> There's no problem if two ObjectID's contain the same timestamp.  It
>> doesn't matter at all.  What has to be unique is the combination of
>> record# and timestamp -- and that combo must be unique for the entire life
>> of the database.  Happily this is not a problem until April 2038, longer
>> if you chose a different timestamp format.

>Ahh your ID has two parts.  I use something called a CriticalSection
>object to block the ' id++; ' function.  Its very similar to a mutex,
>except the reset occurs automatically upon leaving  the code section. 
>Its supposed be slightly more efficient, but I believe its really a mutex
>under the covers. I use it alot, all over the place. :-)

Check into the base code for your CriticalSection.  I've seen far to many
such blobs whose definition of a critical section is that it is the ONLY
thread in the application allowed to execute for the duration.  <shudder> 
(This how OS/2 and Windows handle their "critical section" API's, and I've
seen something similar in a library that shall remain nameless for SunOS).

>> I'm rather pleased actually -- the last time I had the server in a shape
>> it would actually run, I had it creating and destroying about 100,000
>> objects per hour while mobiles wandered about the game going in and out of
>> spoof/watcher areas, and breeding like crazy.  
>> Figure, that's what, about 40+ million objects being created and
>> destroyed...  Certainly not enough to cause a 32bit wrap, but a good
>> enough test to demonstrate that the idea works. 

>Whoa Nelly!   I don't expect to reach anything approaching this rate of
>creation and destruction.  

Neither do I for actual production databases.  It was a contrived stress
test of the area.  I tend to do a lot of those sorts of things.  

  Okay, we'll create two rooms linked by a single door.  
  Now lets create a simple mobile that just bounces back and 
    forth between those rooms thru that door.
  Now lets clone that puppy a few thousand times.
  Turn on the box and see what happens!

>Have you checked your machine for viruses lately? ;-)

Heck.  I am the virus.

J C Lawrence                               Internet: claw at null.net
----------(*)                              Internet: coder at ibm.net
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...

More information about the MUD-Dev mailing list