1998Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: atomic functions -->
<!--X-From-R13: "Tryvk O. Qebrf" <sryvkNkf1.fvzcyrk.ay> -->
<!--X-Date: Sat, 2 May 1998 16:26:03 &#45;0700 -->
<!--X-Message-Id: 199805022323.BAA14729#xs1,simplex.nl -->
<!--X-Content-Type: text/plain -->
<!--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:felix#xs1,simplex.nl">
</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="msg00333.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00335.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00333.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00335.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00334">Author</A>
&nbsp;|&nbsp;<A HREF="#00334">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00334">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>: "Felix A. Croes" &lt;<A HREF="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</A>&gt;</LI>
<LI><em>Date</em>: Sun, 3 May 1998 01:23:32 +0200 (MET DST)</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>
Jon A. Lambert &lt;jlsysinc#ix,netcom.com&gt; wrote:

&gt;[...]
&gt; Very interesting.  J.C. has been quite convincing and has opened my 
&gt; eyes to many good ideas in this area.  I'm adopting something I've 
&gt; dubbed S&amp;S or Spin-Lock and Swizzle.  In essence a multithreaded 
&gt; locking system.  But ignoring this implementation detail, the 
&gt; language implementation is more relevant here. 
&gt;
&gt; My terminology differs with yours slightly: 
&gt;
&gt;    Transaction == Event == Atomic function 
&gt;         ... and is assumed to be == Thread   
&gt;    Method call == Function call
&gt;    Event Method() ~?~ Atomic {fragment} --&gt; not sure here

"Event function"?  I had not thought of a name for it yet, but definitely
not atomic fragment.


&gt; And from the posted examples of pseudocode we have: 
&gt;
&gt; Felix:
&gt;  foo()
&gt;  {
&gt;      /* code fragment 1 */
&gt;
&gt;      atomic {
&gt;   /* code fragment 2, executed atomically */
&gt;      }
&gt;
&gt;      /* code fragment 3 */
&gt;  }
&gt;
&gt; Jon:
&gt;  foo()
&gt;  {
&gt;      /* code fragment 1 */
&gt;      event bar();  /* bar is sceduled for execution as an atomic 
&gt;                       function or independent event.  Execution
&gt;                       foo() is not suspended but continues 
&gt;                     */
&gt;      bar(); /* executes bar() as a normal function bar is part of foo */  
&gt;         /* code fragment 3 */
&gt;  }
&gt;  bar()  
&gt;  {
&gt;      /* code fragment 3 */
&gt;  }
&gt;
&gt; Either foo() or bar() may be events or normal functions. Whether they are 
&gt; atomic events scheduled for independent execution is dependent on how 
&gt; they are called.  Commits are done on successful event completion.  
&gt; Rollbacks are done on event failure. 
&gt;
&gt; I think the difference may lie in that your atomic is
&gt; more like:
&gt;
&gt;  foo()
&gt;  {
&gt;      /* code fragment 1 */
&gt;      BEGIN_TRANSACTION{
&gt;      /* code fragment 2, executed atomically */
&gt;      }
&gt;      COMMIT_TRANSACTION
&gt;      /* code fragment 3 */
&gt;  }
&gt;
&gt; Whilst mine is:
&gt;
&gt;  foo()
&gt;  {
&gt;      /* code fragment 1 */
&gt;      FORK bar()
&gt;      /* code fragment 3 */
&gt;  }
&gt;
&gt; No? More comments? 

Note that I mean to have atomic sections &lt;in addition to&gt; multithreading
with commits and rollbacks (even though I may not implement them as
rollbacks).

Shawn has made me realize that there are two kinds of "atomicness".
First, every (completed and committed) event can be said to be atomic
in the sense that it does not overlap with other (completed and
committed) events.

Second, a section of code can be said to be atomic if it is executed
either entirely or not at all.  In my system, the two kinds are
distinct.  In Shawn's, they are identical.  In a system that is
multithreading in the same way but in which a runtime error does
not cause the event to fail, only the first kind exists.

What made me confuse the two kinds of "atomicness" is that they
can be implemented with almost exactly the same code.

Felix Croes

-- 
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-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00333.html">[MUD-Dev] Re: atomic functions</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00335.html">[MUD-Dev] Re: atomic functions</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00333.html">[MUD-Dev] Re: atomic functions</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00335.html">[MUD-Dev] Re: atomic functions</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00334"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00334"><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>
<LI><strong><A NAME="00298" HREF="msg00298.html">[MUD-Dev] Re: atomic functions</A></strong>, 
Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Fri 01 May 1998, 17:27 GMT
<UL>
<LI><strong><A NAME="00331" HREF="msg00331.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, 18:16 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00420" HREF="msg00420.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, 17:39 GMT
</LI>
<LI><strong><A NAME="00333" HREF="msg00333.html">[MUD-Dev] Re: atomic functions</A></strong>, 
Felix A. Croes <a href="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</a>, Sat 02 May 1998, 23:25 GMT
</LI>
<LI><strong><A NAME="00334" HREF="msg00334.html">[MUD-Dev] Re: atomic functions</A></strong>, 
Felix A. Croes <a href="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</a>, Sat 02 May 1998, 23:26 GMT
</LI>
<LI><strong><A NAME="00335" HREF="msg00335.html">[MUD-Dev] Re: atomic functions</A></strong>, 
Felix A. Croes <a href="mailto:felix#xs1,simplex.nl">felix#xs1,simplex.nl</a>, Sat 02 May 1998, 23:26 GMT
<UL>
<LI><strong><A NAME="00336" HREF="msg00336.html">[MUD-Dev] Re: atomic functions</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sun 03 May 1998, 05:49 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00338" HREF="msg00338.html">[MUD-Dev] Re: atomic functions</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sun 03 May 1998, 17:16 GMT
<UL>
<LI><strong><A NAME="00344" HREF="msg00344.html">[MUD-Dev] Re: atomic functions</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sun 03 May 1998, 15:19 GMT
</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>