1998Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: lockless system &#45; foolproof? -->
<!--X-From-R13: "F. Oyrknaqre Bbcvry" <cbcvryNfahtuneobe.pbz> -->
<!--X-Date: Mon, 31 Aug 1998 07:42:38 &#45;0700 -->
<!--X-Message-Id: 199808311440.HAA14669#cashew,snugharbor.com.snugharbor.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: E0zDMqj&#45;0000QX&#45;00#mail,kanga.nu -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Re: lockless system - foolproof?</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:popiel#snugharbor,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="msg00885.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00887.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00883.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00899.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00886">Author</A>
&nbsp;|&nbsp;<A HREF="#00886">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00886">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: lockless system - foolproof?</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: lockless system - foolproof? </LI>
<LI><em>From</em>: "T. Alexander Popiel" &lt;<A HREF="mailto:popiel#snugharbor,com">popiel#snugharbor,com</A>&gt;</LI>
<LI><em>Date</em>: Mon, 31 Aug 1998 07:40:10 -0600</LI>
<LI><em>cc</em>: <A HREF="mailto:popiel#snugharbor,com">popiel#snugharbor,com</A></LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#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>
In message:  &lt;<A HREF="msg00883.html">E0zDMqj-0000QX-00#mail,kanga.nu</A>&gt;
             J C Lawrence &lt;claw#kanga,nu&gt; writes:

&gt;  Assume a SHOUT command that passes its argument to all players and
&gt;NPCs.  The obvious (and actually fairly common) approach is something
&gt;as follows:
&gt;
&gt;  for target in (players &amp;&amp; NPCs)
&gt;    deliver string
&gt;
&gt;This is an obvious high contention candidate as the working set by the
&gt;end of the event will be extremely large.  A possible low-contention
&gt;implementation, might be the following:
&gt;
&gt;    1) Logs an event X which does nothing collect a list of all
&gt;players and NPC's (fairly trivial by traversing the child-list of the
&gt;relevant root objects, thus having a working set of only two objects),
&gt;and then, as part of its C&amp;C logs further events, either one per
&gt;target object, or one per small sub-set of target objects (lists are
&gt;your friend).  This executes rapidly and has minimal contention.
&gt;
&gt;  2) The secondary logged events then run and deliver the string to
&gt;the relevant player/NPC's, each with a total working set of only the
&gt;target object, and thus minimal contention.  These execute extremely
&gt;rapidly and have minimal contention.
&gt;
&gt;Of course this also means that your execution model had better be
&gt;pretty efficient or you will spend all your time in the overhead of
&gt;building and tearing down events rathr than executing them.

This sounds like it would open your game to event-order confusion.
Imagine someone holding an auction via shout... and two people
shout at nearly the same time.  Because of the separation of
different targets into different events, the auction master and
each of the shouters could be notified in different events.
Because of your parallel execution race-condition for C&amp;C, they
could hear the shouts in different orders.  This'll lead to some
very nice flame festivals when the item under auction gets sold
to the "wrong" person...

  Cast: Auction master M, Bidder A, and Bidder B.

  Bidder A shouts "1500!" (event A0)
  Bidder B shouts "1500!" (event B0)
  Shout A0 gets broken up into AM, AA, AB
  Shout AB gets broken up into BM, BA, BB.
  AM passes C&amp;C, M hears "A: 1500!", BM rescheduled.
  BB passes C&amp;C, B hears "B: 1500!", AB rescheduled.
  BM passes C&amp;C, M hears "B: 1500!".
  AA passes C&amp;C, A hears "A: 1500!", BA rescheduled.
  AB passes C&amp;C, B hears "A: 1500!".
  BA passes C&amp;C, A hears "B: 1500!".
  M sells to A.
  B PKills M.

- Alex


</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="00899" HREF="msg00899.html">[MUD-Dev] Re: lockless system - foolproof?</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="00883" HREF="msg00883.html">[MUD-Dev] Re: lockless system - foolproof?</A></STRONG>
<UL><LI><EM>From:</EM> J C Lawrence &lt;claw#kanga,nu&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00885.html">[MUD-Dev] Re: Modular MUD</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00887.html">[MUD-Dev] Re: Modular MUD</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00883.html">[MUD-Dev] Re: lockless system - foolproof?</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00899.html">[MUD-Dev] Re: lockless system - foolproof?</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00886"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00886"><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><A NAME="00870" HREF="msg00870.html">[MUD-Dev] lockless system - foolproof?</A></strong>, 
James Wilson <a href="mailto:jwilson#rochester,rr.com">jwilson#rochester,rr.com</a>, Sun 30 Aug 1998, 05:34 GMT
<UL>
<LI><strong><A NAME="00878" HREF="msg00878.html">[MUD-Dev] Re: lockless system - foolproof?</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Sun 30 Aug 1998, 20:20 GMT
<UL>
<LI><strong><A NAME="00882" HREF="msg00882.html">[MUD-Dev] Re: lockless system - foolproof?</A></strong>, 
James Wilson <a href="mailto:jwilson#rochester,rr.com">jwilson#rochester,rr.com</a>, Mon 31 Aug 1998, 01:09 GMT
<UL>
<LI><strong><A NAME="00883" HREF="msg00883.html">[MUD-Dev] Re: lockless system - foolproof?</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Mon 31 Aug 1998, 05:49 GMT
<UL>
<LI><strong><A NAME="00886" HREF="msg00886.html">[MUD-Dev] Re: lockless system - foolproof?</A></strong>, 
T. Alexander Popiel <a href="mailto:popiel#snugharbor,com">popiel#snugharbor,com</a>, Mon 31 Aug 1998, 14:42 GMT
<UL>
<LI><strong><A NAME="00899" HREF="msg00899.html">[MUD-Dev] Re: lockless system - foolproof?</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Tue 01 Sep 1998, 17:50 GMT
<UL>
<LI><strong><A NAME="00903" HREF="msg00903.html">[MUD-Dev] Re: lockless system - foolproof?</A></strong>, 
T. Alexander Popiel <a href="mailto:popiel#snugharbor,com">popiel#snugharbor,com</a>, Wed 02 Sep 1998, 04:57 GMT
<UL>
<LI><strong><A NAME="00915" HREF="msg00915.html">[MUD-Dev] Re: lockless system - foolproof?</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Wed 02 Sep 1998, 20:50 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00896" HREF="msg00896.html">[MUD-Dev] Re: lockless system - foolproof?</A></strong>, 
James Wilson <a href="mailto:jwilson#rochester,rr.com">jwilson#rochester,rr.com</a>, Tue 01 Sep 1998, 03:51 GMT
</LI>
</UL>
</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>