<!-- MHonArc v2.4.4 --> <!--X-Subject: [MUD-Dev] Re: atomic functions --> <!--X-From-R13: Eunja Vnycraal <znynpunvNvanzr.pbz> --> <!--X-Date: Thu, 30 Apr 1998 13:19:45 -0700 --> <!--X-Message-Id: 19980430161844.C346#sun104,humb.nt.com --> <!--X-Content-Type: text/plain --> <!--X-Reference: 199804300159.DAA16625#xs1,simplex.nl --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, [MUD-Dev] Re: atomic functions</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:malachai#iname,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="msg00277.html">Previous</a> | <a href="msg00279.html">Next</a> ] Thread: [ <a href="msg00256.html">Previous</a> | <a href="msg00406.html">Next</a> ] Index: [ <A HREF="author.html#00278">Author</A> | <A HREF="#00278">Date</A> | <A HREF="thread.html#00278">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>[MUD-Dev] Re: atomic functions</H1> <HR> <!--X-Subject-Header-End--> <!--X-Head-of-Message--> <UL> <LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> <LI><em>Subject</em>: [MUD-Dev] Re: atomic functions</LI> <LI><em>From</em>: Shawn Halpenny <<A HREF="mailto:malachai#iname,com">malachai#iname,com</A>></LI> <LI><em>Date</em>: Thu, 30 Apr 1998 16:18:44 -0400</LI> <LI><em>Delivery-date</em>: Thu Apr 30 13:19:46 1998</LI> <LI><em>Delivery-date</em>: Thu, 30 Apr 1998 13:19:46 -0700</LI> <LI><em>Envelope-to</em>: claw#kanga,nu</LI> <LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> <LI><em>Sender</em>: "Petidomo List Agent,,,," <<A HREF="mailto:petidomo#kanga,nu">petidomo#kanga,nu</A>></LI> </UL> <!--X-Head-of-Message-End--> <!--X-Head-Body-Sep-Begin--> <HR> <!--X-Head-Body-Sep-End--> <!--X-Body-of-Message--> <PRE> On Thu, Apr 30, 1998 at 03:59:20AM +0200, Felix A. Croes wrote: > Having recently completed the implementation of the generic parsing > utility that I posted about earlier, I am now preparing to convert > my server to the lockless multithreading paradigm put forward on this > list by J.C. Lawrence. > > It has occurred to me that the commit-or-fail idea can be applied to > parts of threads as well as entire threads, leading to the following > concept of "atomic functions": > > An atomic function is a function that succeeds or fails as a > whole. Any runtime error that is not caught within the function > will lead to the entire function call, with all its effects > and side-effects, being undone. For me, a function cannot be executed without having a corresponding event: it is tied tightly to the lockless-ness of the DB commits. Events accumulate a working set. If those objects are committed (and they will be if no other event has already finished with its objects and has C&C'd), then the thread that was executing that event effectively "dies" (although it's kept around in a pool for subsequent quick reuse) and the event is no more. I would consider each executing event method an atomic function as you've described them--all of the effects undone on failed C&C reset the world state for that event to the new current state. A runtime error in a function essentially amounts to a failed C&C, since the end result is the same: no changes persist. However, a failed function will cause the event method in which it was called to not be rescheduled and thus it will not attempt to C&C again. A C&C failure without a corresponding function error is perfectly acceptable and, in fact, required. > Atomic functions would be used to enforce consistency -- just like a > thread either fails or succeeds without leaving the mud in an > inconsistent, half-completed state. Of course, every function called > at the beginning of a thread is effectively called atomically, so > code that depends on atomic functions can be replaced by code that > depends on (atomic) threads. The advantage of atomic functions > would be to place the function call within the wider thread > context, which would be similar to imposing an execution order on > threads. Also, calls to atomic functions could be nested. I'm not sure I understand how this alone will impose an execution order. If I have threads (I could even substitute "events") executing in parallel, normally whichever is able to C&C first, wins. Any order I impose on executing events depends on sequence numbers associated with the events themselves. Design details about the sequencing are still muddy, since I'm re-examining my approach. -- Shawn Halpenny I know that you believe you understand what you think I said, but, I am not sure you realize that what you heard is not what I meant. -- MUD-Dev: Advancing an unrealised future. </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <ul compact><li><strong>Follow-Ups</strong>: <ul> <li><strong><A NAME="00406" HREF="msg00406.html">[MUD-Dev] Re: atomic functions</A></strong> <ul compact><li><em>From:</em> J C Lawrence <claw#under,engr.sgi.com></li></ul> </UL></LI></UL> <!--X-Follow-Ups-End--> <!--X-References--> <UL><LI><STRONG>References</STRONG>: <UL> <LI><STRONG><A NAME="00256" HREF="msg00256.html">[MUD-Dev] atomic functions</A></STRONG> <UL><LI><EM>From:</EM> "Felix A. Croes" <felix#xs1,simplex.nl></LI></UL></LI> </UL></LI></UL> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00277.html">[MUD-Dev] RE: DOOM Gets a Storyline?</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00279.html">[MUD-Dev] Re: (fwd) AD: [custom graphical] whitestar</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00256.html">[MUD-Dev] atomic functions</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00406.html">[MUD-Dev] Re: atomic functions</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00278"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00278"><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>[MUD-Dev] Re: regulating player-created objects</STRONG>, <EM>(continued)</EM> <ul compact> <ul compact> <LI><strong><A NAME="00439" HREF="msg00439.html">[MUD-Dev] Re: regulating player-created objects</A></strong>, Dan Shiovitz <a href="mailto:dbs#cs,wisc.edu">dbs#cs,wisc.edu</a>, Wed 06 May 1998, 21:37 GMT <UL> <LI><strong><A NAME="00456" HREF="msg00456.html">[MUD-Dev] Re: regulating player-created objects</A></strong>, Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Thu 07 May 1998, 13:59 GMT </LI> <LI><strong><A NAME="00512" HREF="msg00512.html">[MUD-Dev] Re: regulating player-created objects</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Tue 12 May 1998, 01:25 GMT </LI> </UL> </LI> </ul> </ul> </LI> <LI><strong><A NAME="00256" HREF="msg00256.html">[MUD-Dev] atomic functions</A></strong>, Felix A. Croes <a href="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</a>, Thu 30 Apr 1998, 02:00 GMT <UL> <LI><strong><A NAME="00278" HREF="msg00278.html">[MUD-Dev] Re: atomic functions</A></strong>, Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Thu 30 Apr 1998, 20:19 GMT <UL> <LI><strong><A NAME="00406" HREF="msg00406.html">[MUD-Dev] Re: atomic functions</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Tue 05 May 1998, 17:53 GMT </LI> </UL> </LI> <LI><strong><A NAME="00322" HREF="msg00322.html">[MUD-Dev] Re: atomic functions</A></strong>, Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sat 02 May 1998, 07:39 GMT <UL> <LI><strong><A NAME="00427" HREF="msg00427.html">[MUD-Dev] Re: atomic functions</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Wed 06 May 1998, 18:45 GMT <UL> <LI><strong><A NAME="00551" HREF="msg00551.html">[MUD-Dev] Re: atomic functions</A></strong>, Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Wed 13 May 1998, 19:54 GMT </LI> </UL> </LI> </UL> </LI> </UL> </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>