1998Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: atomic functions -->
<!--X-From-R13: Eunja Vnycraal <znynpunvNvanzr.pbz> -->
<!--X-Date: Thu, 30 Apr 1998 13:19:45 &#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>
[&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="msg00277.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00279.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00256.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00406.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00278">Author</A>
&nbsp;|&nbsp;<A HREF="#00278">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00278">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>: Shawn Halpenny &lt;<A HREF="mailto:malachai#iname,com">malachai#iname,com</A>&gt;</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,,,," &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 Thu, Apr 30, 1998 at 03:59:20AM +0200, Felix A. Croes wrote:
&gt; Having recently completed the implementation of the generic parsing
&gt; utility that I posted about earlier, I am now preparing to convert
&gt; my server to the lockless multithreading paradigm put forward on this
&gt; list by J.C. Lawrence.
&gt; 
&gt; It has occurred to me that the commit-or-fail idea can be applied to
&gt; parts of threads as well as entire threads, leading to the following
&gt; concept of "atomic functions":
&gt; 
&gt;     An atomic function is a function that succeeds or fails as a
&gt;     whole.  Any runtime error that is not caught within the function
&gt;     will lead to the entire function call, with all its effects
&gt;     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&amp;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&amp;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&amp;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&amp;C again.  A C&amp;C failure without a corresponding function error is
perfectly acceptable and, in fact, required.  

&gt; Atomic functions would be used to enforce consistency -- just like a
&gt; thread either fails or succeeds without leaving the mud in an
&gt; inconsistent, half-completed state.  Of course, every function called
&gt; at the beginning of a thread is effectively called atomically, so
&gt; code that depends on atomic functions can be replaced by code that
&gt; depends on (atomic) threads.  The advantage of atomic functions
&gt; would be to place the function call within the wider thread
&gt; context, which would be similar to imposing an execution order on
&gt; 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&amp;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 &lt;claw#under,engr.sgi.com&gt;</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" &lt;felix#xs1,simplex.nl&gt;</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>
[&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>