1998Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: atomic functions -->
<!--X-From-R13: X Q Znjerapr <pynjNhaqre.rate.ftv.pbz> -->
<!--X-Date: Fri, 15 May 1998 13:30:24 &#45;0700 -->
<!--X-Message-Id: 199805152030.NAA01999#under,engr.sgi.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199805131953.OAA25486@dfw&#45;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>
[&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="msg00611.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00613.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00551.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00404.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00612">Author</A>
&nbsp;|&nbsp;<A HREF="#00612">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00612">Thread</A>
&nbsp;]

<!--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 &lt;<A HREF="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</A>&gt;</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" &lt;<A HREF="mailto:petidomo#kanga,nu">petidomo#kanga,nu</A>&gt;</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&lt;jlsysinc#ix,netcom.com&gt; wrote:

&gt; On 6 May 98, J C Lawrence wrote:

&gt;&gt; On Sat, 2 May 1998 03:41:43 -5 Jon A
&gt;&gt; Lambert&lt;jlsysinc#ix,netcom.com&gt; wrote:

&gt; S&amp;S is an object locking mechanism as opposed to C&amp;C which does not
&gt; lock.  When an event begins execution and as it executes locks are
&gt; attempted against objects referenced by the MPL bytecode.  Locks can
&gt; be of three types; read, write, and dontcare.  Dontcare locks are a
&gt; special case and must be explicitly coded.  Read and write locks are
&gt; implicit.  The assumption of my model is that an event is the same
&gt; as a transaction, thus committing of changes occurs at the events
&gt; return.  The fundamental difference from C&amp;C is that when an event
&gt; returns, it is guaranteed to commit, and an event has knowledge of
&gt; it's success at a certain point and may act upon it.

Another key difference is that S&amp;S allows (nay, actively encourages)
the user/programmer to actively consider and manipulate the locking
schema, where-as C&amp;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.

&gt;&gt; Problem:
&gt;&gt; 
&gt;&gt; Foo() executes, and launches bar() as a seperate execution thread.
&gt;&gt; 
&gt;&gt; Foo() then fails C&amp;C (S&amp;S?).
&gt; 
&gt; Foo() may have guaranteed it's success.  It depends on whether the
&gt; requisite locks that bar() needs were already obtained within foo().
&gt; If, for instance, foo() and bar() are operations referencing the
&gt; same object then foo() is guaranteed success at the point it issues
&gt; event bar().  It's a poor example because I can't imagine why one
&gt; would invoke bar() as a method and as an event within foo().  But if
&gt; you replace event bar() with event xxx() then it makes some logical
&gt; sense as this fragment was just to illustrate the methods had two
&gt; ways they could be invoked, synchronously or asynchronously.

&gt;&gt; What happens to the launched bar()?
&gt;&gt; 
&gt; It attempts to execute.

&gt;&gt; Foo() reschedules, does it launch a new bar()?
&gt;&gt; 
&gt; Yes

This would seem a possible even likely source of logical
inconsistencies.

&gt;&gt; At some point data changes have to be committed.  Given the
&gt;&gt; rollback and reschedule aspect of the C&amp;C approach, on what logical
&gt;&gt; basis can you have nested commit structures or event fork()s
&gt;&gt; _prior_ to commit?

&gt; I have always been of the opinion that application logic cannot be
&gt; known priori by the underlying mechanisms of the server.  The server
&gt; may only provide the mechanisms, but it's still the task of the MPL
&gt; programmer to explicit code application logic.  

&lt;nod&gt;  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" &lt;jlsysinc#ix,netcom.com&gt;</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>
[&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>