<!-- MHonArc v2.4.4 --> <!--X-Subject: [MUD-Dev] Re: atomic functions --> <!--X-From-R13: X Q Znjerapr <pynjNhaqre.rate.ftv.pbz> --> <!--X-Date: Fri, 15 May 1998 13:30:24 -0700 --> <!--X-Message-Id: 199805152030.NAA01999#under,engr.sgi.com --> <!--X-Content-Type: text/plain --> <!--X-Reference: 199805131953.OAA25486@dfw-ix16.ix.netcom.com --> <!--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:claw#under,engr.sgi.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="msg00611.html">Previous</a> | <a href="msg00613.html">Next</a> ] Thread: [ <a href="msg00551.html">Previous</a> | <a href="msg00404.html">Next</a> ] Index: [ <A HREF="author.html#00612">Author</A> | <A HREF="#00612">Date</A> | <A HREF="thread.html#00612">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>: J C Lawrence <<A HREF="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</A>></LI> <LI><em>Date</em>: Fri, 15 May 1998 13:30:14 -0700</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 -- Kanga.Nu version" <<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 Wed, 13 May 1998 15:54:52 -5 Jon A Lambert<jlsysinc#ix,netcom.com> wrote: > On 6 May 98, J C Lawrence wrote: >> On Sat, 2 May 1998 03:41:43 -5 Jon A >> Lambert<jlsysinc#ix,netcom.com> wrote: > S&S is an object locking mechanism as opposed to C&C which does not > lock. When an event begins execution and as it executes locks are > attempted against objects referenced by the MPL bytecode. Locks can > be of three types; read, write, and dontcare. Dontcare locks are a > special case and must be explicitly coded. Read and write locks are > implicit. The assumption of my model is that an event is the same > as a transaction, thus committing of changes occurs at the events > return. The fundamental difference from C&C is that when an event > returns, it is guaranteed to commit, and an event has knowledge of > it's success at a certain point and may act upon it. Another key difference is that S&S allows (nay, actively encourages) the user/programmer to actively consider and manipulate the locking schema, where-as C&C explicitly hides all that from the programmer, and denies all access to any event success/failure data during execution. The choice at that level then is: You can have your code work with the system, attempting to be a "good citizen" and taking advantage of the rules where applicable, or you can have your code on a competitive footing with all the other code on the system, and its up to you as a programmer to make your code fleeter of processor and lighter of tread than all the rest to ensure its rapid execution. >> Problem: >> >> Foo() executes, and launches bar() as a seperate execution thread. >> >> Foo() then fails C&C (S&S?). > > Foo() may have guaranteed it's success. It depends on whether the > requisite locks that bar() needs were already obtained within foo(). > If, for instance, foo() and bar() are operations referencing the > same object then foo() is guaranteed success at the point it issues > event bar(). It's a poor example because I can't imagine why one > would invoke bar() as a method and as an event within foo(). But if > you replace event bar() with event xxx() then it makes some logical > sense as this fragment was just to illustrate the methods had two > ways they could be invoked, synchronously or asynchronously. >> What happens to the launched bar()? >> > It attempts to execute. >> Foo() reschedules, does it launch a new bar()? >> > Yes This would seem a possible even likely source of logical inconsistencies. >> At some point data changes have to be committed. Given the >> rollback and reschedule aspect of the C&C approach, on what logical >> basis can you have nested commit structures or event fork()s >> _prior_ to commit? > I have always been of the opinion that application logic cannot be > known priori by the underlying mechanisms of the server. The server > may only provide the mechanisms, but it's still the task of the MPL > programmer to explicit code application logic. <nod> The problem I have with this is that I am all too familiar with the cases of unpredicted race conditions and error cases, especially as code is maintained over time. I explicitly wanted a system which attempted to be proof against such by rabidly insisting on the logical correctness of its execution model. In this particular case, correct code which spawns a seperate event during its execution may be safe now, but later edits to unrelated but called code can remove that safety: foo() { event bar(); baz(); } baz() { other.call (); } This as originally implemented is safe. However, later the code for "other" is edited such that the call to other.call() *may* potentially fail. This opens the door to bar() being launched repetitively as the foo() event gets rescheduled. Note that this does not violate your conventions, tho it may be trapped by your compiler model depending on how you do it. -- J C Lawrence Internet: claw#null,net (Contractor) Internet: coder#ibm,net ---------(*) Internet: claw#under,engr.sgi.com ...Honourary Member of Clan McFud -- Teamer's Avenging Monolith... -- MUD-Dev: Advancing an unrealised future. </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <!--X-Follow-Ups-End--> <!--X-References--> <UL><LI><STRONG>References</STRONG>: <UL> <LI><STRONG><A NAME="00551" HREF="msg00551.html">[MUD-Dev] Re: atomic functions</A></STRONG> <UL><LI><EM>From:</EM> "Jon A. Lambert" <jlsysinc#ix,netcom.com></LI></UL></LI> </UL></LI></UL> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00611.html">[MUD-Dev] Re: Mudschool</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00613.html">[MUD-Dev] Re: atomic functions</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00551.html">[MUD-Dev] Re: atomic functions</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00404.html">[MUD-Dev] Re: atomic functions</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00612"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00612"><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: atomic functions</STRONG>, <EM>(continued)</EM> <ul compact> <ul compact> <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><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 <UL> <LI><strong><A NAME="00612" HREF="msg00612.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>, Fri 15 May 1998, 20:30 GMT </LI> </UL> </LI> </UL> </LI> </UL> </LI> <LI><strong><A NAME="00404" HREF="msg00404.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, 16:53 GMT </LI> </ul> </LI> <LI><strong><A NAME="00254" HREF="msg00254.html">[MUD-Dev] Re: Mud-Client, and specifically, COOLMud and SFWhite</A></strong>, Jay Sax <a href="mailto:cimri1#gte,net">cimri1#gte,net</a>, Thu 30 Apr 1998, 01:41 GMT <UL> <LI><strong><A NAME="00257" HREF="msg00257.html">[MUD-Dev] Re: Mud-Client, and specifically, COOLMud and SFWhite</A></strong>, Dan Root <a href="mailto:dar#thekeep,org">dar#thekeep,org</a>, Thu 30 Apr 1998, 02:34 GMT </LI> <LI><strong><A NAME="00306" HREF="msg00306.html">[MUD-Dev] Re: Mud-Client, and specifically, COOLMud and SFWhite</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Fri 01 May 1998, 22:01 GMT </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>