<!-- MHonArc v2.4.4 --> <!--X-Subject: Re: Random thoughts --> <!--X-From-R13: pynjerapNphc.uc.pbz --> <!--X-Date: from babe.globecomm.net [207.51.48.8] by mx01.ca.us.ibm.net id 860796646.196062-1 Fri Apr 11 22:10:46 1997 --> <!--X-Message-Id: 199704112209.PAA28658#xsvr3,cup.hp.com --> <!--X-Content-Type: text/plain --> <!--X-Reference: 199704080234.CAA489247#out2,ibm.net --> <!--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:clawrenc#cup,hp.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> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00089.html">Previous</a> | <a href="msg00092.html">Next</a> ] Thread: [ <a href="msg00047.html">Previous</a> | <a href="msg00109.html">Next</a> ] Index: [ <A HREF="author.html#00091">Author</A> | <A HREF="#00091">Date</A> | <A HREF="thread.html#00091">Thread</A> ] <!--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" <<A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A>></LI> <LI><em>Subject</em>: Re: Random thoughts</LI> <LI><em>From</em>: <A HREF="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</A></LI> <LI><em>Date</em>: Thu, 10 Apr 97 14:45:22 -0700</LI> <LI><em>Reply-to</em>: <A HREF="mailto:claw#null,net">claw#null,net</A></LI> </UL> <!--X-Head-of-Message-End--> <!--X-Head-Body-Sep-Begin--> <HR> <!--X-Head-Body-Sep-End--> <!--X-Body-of-Message--> <PRE> In <199704080234.CAA489247#out2,ibm.net>, on 04/07/97 at 10:33 PM, "Jon A. Lambert" <jlsysinc#ix,netcom.com> said: >> From: coder#ibm,net >> On 05/04/97 at 06:02 PM, "Jon A. Lambert" <jlsysinc#ix,netcom.com> said: >> >> > How does this handle the Dragon's Dinner scenario, ala: ><snipped - you've probably put us all through it :-) > >> >> For me there actually is no problem as the general area is resolved by my >> lockless/retry model (the old C&C business I detailed, Oh, about 6 - 8 >> postings ago -- I'll repost if needed.). Essentially the two events >> execute in parallel, but one gets to C&C first and commits, the other then >> fails C&C, and retries/reschedules. This only works becuase all events >> only modify and access local data prior to C&C. >> >Concerning the C&C (copy and compare(?)): C&C == Compare&Commit. Unfortunately I don't have a blob to cut'n'paste in on this, so here goes round the mulberry bush again: I run a lockless server. I use no read or write locking. Events compete competitively to commit as transactions. Those that lose reschedule, and try again. To detail: Events request objects from the DB. If the object is not in the cache, the DB loads the object. The DB replies to the event with a read-only shared reference to the object. The event is added to the "interested parties" list for the object. If the event attempts to modify the object, a new local, event-specific copy of the object is made, and the changes are made to that. A copy of the original reference however is still kept. The event (loosely) attempts to keep track of what members of the object it referenced. Upon the event terminating it compares its copy of the original object (the local reference) with the object that's actually in the DB (may have been changed by events commiting during the current event's execution). Some intelligence is attempted here to only compare those values etc which were referenced by the event. Should the original copy and the current-in-DB copy compare OK, then the event commits and all its changes in its written-to copies are commited atomically. This is the Compare&Commit, or C&C. If the C&C fail, the event is thrown away, all the copies are released, and the event is rescheduled. There is also some background intelligence here where the DB watches the objects that are affected by event's C&C'ing, and will signal the other events that are members of those object's interested party list that they may be invalidated by the other event's C&C and so should kill themselves and reschedule. >The DB is not comparing the object on an element by element basis, is >it? Is it doing a memory contents comparison? >Does the object contain a "magic number"? >Does this copy and compare include object method code? >I'm thinking of using a "magic-number" marking to determine whether >my objects are dirty in cache. Ala CRC? >Any thoughts on multi-threading the language implementation? What >happens when the same objects method is called by a second thread? Not a problem. My language internally is thread safe (took a lot work, mostly me finally figuring out how much design work I really had to do up-front). after that everything is handled by the transactional nature of the events -- Nothing inside of an event actually exists or is changed until C&C, so the question doesn't even arise. Until that event C&C's, it really doesn't matter what the objects states are intal to that event. >Does this entail writing fully renterant and reusable code in the >server language implementation? Yup. This can get very interesting. Start out viewing your language system as a stack based state machine with the state determined _externally_ to the machine, and it gets easier. -- J C Lawrence Internet: claw#null,net (Contractor) Internet: coder#ibm,net ---------------(*) Internet: clawrenc#cup,hp.com ...Honorary Member Clan McFUD -- Teamer's Avenging Monolith... </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="msg00089.html">Re: Greetings. :)</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00092.html">Re: Resets and repops</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00047.html">Re: Random thoughts</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00109.html">Re: Random thoughts</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00091"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00091"><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="00041" HREF="msg00041.html">Re: Random thoughts</A></strong>, coder <a href="mailto:coder#ibm,net">coder#ibm,net</a>, Tue 08 Apr 1997, 04:09 GMT </LI> <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 </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>