1997Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: Unique id's -->
<!--X-From-R13: "Xba O. Znzoreg" <wyflfvapNvk.argpbz.pbz> -->
<!--X-Date: from babe.globecomm.net [207.51.48.8] by mx01.ny.us.ibm.net id 860864000.68216&#45;1 Sat Apr 12 16:53:20 1997 -->
<!--X-Message-Id: 199704121652.LAA06283@dfw&#45;ix4.ix.netcom.com -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: Unique id's</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:jlsysinc#ix,netcom.com">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00105.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00107.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00103.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00119.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00106">Author</A>
&nbsp;|&nbsp;<A HREF="#00106">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00106">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: Unique id's</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: "Multiple Recipients of MUD Design Mailing List" &lt;<A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A>&gt;</LI>
<LI><em>Subject</em>: Re: Unique id's</LI>
<LI><em>From</em>: "Jon A. Lambert" &lt;<A HREF="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</A>&gt;</LI>
<LI><em>Date</em>: Sat, 12 Apr 1997 12:55:37 -0400</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
&gt; From: coder#ibm,net
&gt; Subject: Re: Unique id's
&gt; On 12/04/97 at 12:51 AM, "Jon A. Lambert" &lt;jlsysinc#ix,netcom.com&gt; said:
&gt; &gt;Isn't it possible, especially in a multi-threaded system, to generate
&gt; &gt;identical IDs if you depend on date/time stamps?   
&gt; 
&gt; While possible in those loose terms, if your ObjectID allocation code is
&gt; thread-safe its not a problem.  Its just a question of making sure that
&gt; you don't have a race conditions in your container updates/checks to get
&gt; the records# half of the ObjectID (which can be a problem depending on
&gt; your approaches).  I brute forced the issue as I recall my putting a mutex
&gt; on the ObjectID allocation calls so while multiple ID's can be requested
&gt; simultaneously, the actual provision of ID's is serialised.  After that it
&gt; was just a question of making sure that the period that the mutex is
&gt; locked for a call is kept to an absolute minimum.
&gt; 
&gt; Note: This gets messy if you go for a distributed database.
&gt; 
&gt; There's no problem if two ObjectID's contain the same timestamp.  It
&gt; doesn't matter at all.  What has to be unique is the combination of
&gt; record# and timestamp -- and that combo must be unique for the entire life
&gt; of the database.  Happily this is not a problem until April 2038, longer
&gt; if you chose a different timestamp format.
&gt; 

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. :-)

&gt; 
&gt; I found I could easily wrap 2^32 created and destroyed objects in a week
&gt; or so.  That wasn't good enough, and thus was born my current concept of
&gt; recycling and a 64bit time_t/Record# ObjectID.
&gt; 
&gt; I'm rather pleased actually -- the last time I had the server in a shape
&gt; it would actually run, I had it creating and destroying about 100,000
&gt; objects per hour while mobiles wandered about the game going in and out of
&gt; spoof/watcher areas, and breeding like crazy.  stant.
&gt; 
&gt; Figure, that's what, about 40+ million objects being created and
&gt; destroyed...  Certainly not enough to cause a 32bit wrap, but a good
&gt; enough test to demonstrate that the idea works. 
&gt; 

Whoa Nelly!   I don't expect to reach anything approaching this rate of
creation and destruction.  My objects tend to have longer lifetimes.
Of course I don't implement any sort of spoof/watcher objects. 
Sounds a lot like the "life" simulation.     
Have you checked your machine for viruses lately? ;-)


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00105.html">Re: Yet Another Introduction</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00107.html">Re: Of disk swapping, database structure &amp; project management..</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00103.html">Re: Unique id's</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00119.html">Re: Unique id's</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00106"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00106"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><strong><A NAME="00061" HREF="msg00061.html">Unique id's</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Wed 09 Apr 1997, 21:46 GMT
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00094" HREF="msg00094.html">Re: Unique id's</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Sat 12 Apr 1997, 06:03 GMT
</LI>
<LI><strong><A NAME="00101" HREF="msg00101.html">Re: Unique id's</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sat 12 Apr 1997, 11:49 GMT
</LI>
<LI><strong><A NAME="00103" HREF="msg00103.html">Re: Unique id's</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Sat 12 Apr 1997, 13:55 GMT
</LI>
<LI><strong><A NAME="00106" HREF="msg00106.html">Re: Unique id's</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sat 12 Apr 1997, 23:53 GMT
</LI>
<LI><strong><A NAME="00119" HREF="msg00119.html">Re: Unique id's</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Mon 14 Apr 1997, 00:01 GMT
</LI>
<LI><strong><A NAME="00122" HREF="msg00122.html">Re: Unique id's</A></strong>, 
Jeff Kesselman <a href="mailto:jeffk#tenetwork,com">jeffk#tenetwork,com</a>, Mon 14 Apr 1997, 02:40 GMT
</LI>
<LI><strong><A NAME="00123" HREF="msg00123.html">Re: Unique id's</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Mon 14 Apr 1997, 04:31 GMT
</LI>
<LI><strong><A NAME="00131" HREF="msg00131.html">Re: Unique id's</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Mon 14 Apr 1997, 23:24 GMT
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>