1997Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: Random thoughts -->
<!--X-From-R13: "Xba O. Znzoreg" <wyflfvapNvk.argpbz.pbz> -->
<!--X-Date: from fabius.globecomm.net [207.51.48.6] by mx01.ny.us.ibm.net id 860870105.83350&#45;1 Sat Apr 12 18:35:05 1997 -->
<!--X-Message-Id: 199704121834.NAA20755@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: Random thoughts</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="msg00108.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00110.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00091.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00120.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00109">Author</A>
&nbsp;|&nbsp;<A HREF="#00109">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00109">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: Random thoughts</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: Random thoughts</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 14:37:16 -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: clawrenc#cup,hp.com
&gt; Subject: Re: Random thoughts
&gt; Date: Thursday, April 10, 1997 5:45 PM
&gt; 
&gt; C&amp;C == Compare&amp;Commit.  
&gt; 
&gt; Unfortunately I don't have a blob to cut'n'paste in on this, so here
&gt; goes round the mulberry bush again:

This is good.  My synapses have a comparable life-cycle to your
spoof objects.  They decay rapidly over time.     :-)

&gt; 
&gt; I run a lockless server.  I use no read or write locking.  Events
&gt; compete competitively to commit as transactions.  Those that lose
&gt; reschedule, and try again.  To detail:
&gt; 
&gt; Events request objects from the DB.  
&gt; 
&gt; If the object is not in the cache, the DB loads the object.
&gt; 
&gt; The DB replies to the event with a read-only shared reference to the
&gt; object.
&gt; 
&gt; The event is added to the "interested parties" list for the object.
&gt; 
&gt; If the event attempts to modify the object, a new local,
&gt; event-specific copy of the object is made, and the changes are made to
&gt; that.  A copy of the original reference however is still kept.

OK.  I had thoughts along similar lines here. The original reference
MUST be kept by the event, or something equivalent (magic #).

&gt; 
&gt; The event (loosely) attempts to keep track of what members of the
&gt; object it referenced.
&gt; 
&gt; Upon the event terminating it compares its copy of the original object
&gt; (the local reference) with the object that's actually in the DB (may
&gt; have been changed by events commiting during the current event's
&gt; execution).  Some intelligence is attempted here to only compare those
&gt; values etc which were referenced by the event.
&gt; 
The updates attributes are committed only?  Or is the entire object
replaced by the local copy?

For instance:

Event A requests Object X for possible update.
Event B also requests Object X for possible update.
Event A modifies attributes a,c,d on Object X.
Event B modifies attributes b,e on Object X.
Event A requests C&amp;C which is successful and then commits.
Event B requests C&amp;C which is also successful and then commits.

If the entire Object was updated Event B would back
out Event A's updates.  If only attribute updates occur then
you are OK.

&gt; Should the original copy and the current-in-DB copy compare OK, then
&gt; the event commits and all its changes in its written-to copies are
&gt; commited atomically.  This is the Compare&amp;Commit, or C&amp;C.
&gt; 
&gt; If the C&amp;C fail, the event is thrown away, all the copies are
&gt; released, and the event is rescheduled.

Aye and well they should. :-)

&gt; There is also some background intelligence here where the DB watches
&gt; the objects that are affected by event's C&amp;C'ing, and will signal the
&gt; other events that are members of those object's interested party list
&gt; that they may be invalidated by the other event's C&amp;C and so should
&gt; kill themselves and reschedule.

Argh!  And I thought the event would receive a negative response from C&amp;C 
and reschedule itself.  Now your saying that big brother DB is also signaling a 
premature cancellation.   I can see where this would prevent unnecessary 
execution of event code that is fated to fail in any event.  Perhaps saving some
CPU with the added overhead of code complexity. 
Perhaps your DB  would terminate event B with extreme prejudice in my
earlier example?
  
I guess I prefer a kindlier, gentler DB.  You should consider the damage you
do to your events self-esteem by frustrating their attempts at execution at every
turn by a tyrannical DB manager.  This being a philosophical issue as I have yet
to measure this accurately. ;-)
  
&gt; &gt;I'm thinking of using a "magic-number" marking to determine whether
&gt; &gt;my objects are dirty in cache.  
&gt; 
&gt; Ala CRC?

Yes CRC, or MD5 which someone happily pointed me too.  I was thinking
that even with the overhead involved with a magic number system, it could 
be useful in creating a more generic and simpler interface to the DB. 
A request to the Object Manager would return a reference and a CRC value.
A request to update would supply a new object reference along with
the original CRC.  If the CRC matches the update is committed else it
fails.  Perhaps removing this from the event's "knowledge" checking
might mitigate overhead issues and simplify coding? 
 
There is a reliability issue also.  It is possible for CRC to generate matches on 
unlike objects, causing a potential corruption problem.  *shrug*.  A simple
memory compare might be more reliable and efficient, but not as "fun". 

&gt; 
&gt; &gt;Any thoughts on multi-threading the language implementation? What
&gt; &gt;happens when the same objects method is called by a second thread?
&gt; 
&gt; Not a problem.  My language internally is thread safe (took a lot
&gt; work, mostly me finally figuring out how much design work I really had
&gt; to do up-front).  after that everything is handled by the
&gt; transactional nature of the events -- Nothing inside of an event
&gt; actually exists or is changed until C&amp;C, so the question doesn't even
&gt; arise.  Until that event C&amp;C's, it really doesn't matter what the
&gt; objects states are intal to that event.
&gt; 
&gt; &gt;Does this entail writing fully renterant and reusable code in the
&gt; &gt;server  language implementation?
&gt; 
&gt; Yup.  This can get very interesting.  Start out viewing your language
&gt; system as a stack based state machine with the state determined
&gt; _externally_ to the machine, and it gets easier.
&gt; 
Yes.  I'll buy this. 
So thread that resumes execution of a task, only needs a handle to the
task's state.  Execution of the task would continuous be changing the 
state.  Pre-emption of task simply exits leaving the state as is current.
Task state handles are known externally by Task manager.

Kewlio! (did I say that?)  This is MVS without registers!
   
   

</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="msg00108.html">Ho hum</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00110.html">Re: Ho hum (clarifiyign AI terms)</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00091.html">Re: Random thoughts</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00120.html">Re: Random thoughts</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00109"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00109"><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>Re: Random thoughts</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00044" HREF="msg00044.html">Re: Random thoughts</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Tue 08 Apr 1997, 09:25 GMT
</LI>
<LI><strong><A NAME="00045" HREF="msg00045.html">Re: Random thoughts</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Tue 08 Apr 1997, 09:48 GMT
</LI>
<LI><strong><A NAME="00047" HREF="msg00047.html">Re: Random thoughts</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Tue 08 Apr 1997, 13:13 GMT
</LI>
<LI><strong><A NAME="00091" HREF="msg00091.html">Re: Random thoughts</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Sat 12 Apr 1997, 05:10 GMT
</LI>
<LI><strong><A NAME="00109" HREF="msg00109.html">Re: Random thoughts</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sun 13 Apr 1997, 01:35 GMT
</LI>
<LI><strong><A NAME="00120" HREF="msg00120.html">Re: Random thoughts</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Sun 13 Apr 1997, 23:56 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00017" HREF="msg00017.html">Socket Stuff</A></strong>, 
Shawn Halpenny <a href="mailto:rsh#dos,nortel.com">rsh#dos,nortel.com</a>, Sat 05 Apr 1997, 01:39 GMT
<LI><strong><A NAME="00016" HREF="msg00016.html">New guy</A></strong>, 
Walter Goodwin <a href="mailto:jgoodwin#expert,cc.purdue.edu">jgoodwin#expert,cc.purdue.edu</a>, Sat 05 Apr 1997, 00:42 GMT
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00032" HREF="msg00032.html">Re: New guy</A></strong>, 
coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Mon 07 Apr 1997, 09:49 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>