1999Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] dispatching events -->
<!--X-From-R13: [nex Uevggre <znexNreqbf.Egnasbeq.SRG> -->
<!--X-Date: Thu, 22 Jul 1999 14:01:13 &#45;0700 -->
<!--X-Message-Id: 19990722110613.A16109#erdos,Stanford.EDU -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 3796B3EF.61FDEE88@classic&#45;games.com -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] dispatching events</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:mark#erdos,Stanford.EDU">
</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="msg00023.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00026.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00018.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00029.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00024">Author</A>
&nbsp;|&nbsp;<A HREF="#00024">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00024">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] dispatching events</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>: Re: [MUD-Dev] dispatching events</LI>
<LI><em>From</em>: Mark Gritter &lt;<A HREF="mailto:mark#erdos,Stanford.EDU">mark#erdos,Stanford.EDU</A>&gt;</LI>
<LI><em>Date</em>: Thu, 22 Jul 1999 11:06:13 -0700</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#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 Thu, Jul 22, 1999 at 01:02:23AM -0500, Greg Miller wrote:
&gt; 
&gt; I'm working on a lockless C&amp;C game driver at the moment, and I'm
&gt; wondering how others handle the dispatching of events. I see three
&gt; approaches:
&gt; 
&gt; [1] Calling object/function pairs by name. This is simple, but it seems
&gt; rather less flexible than other approaches.
&gt; 
&gt; [2] Subscriptions. In this case I'm referring to events that trigger
&gt; calls to all subscribers as a single atomic unit. More flexible, but I
&gt; can easily envision situations where events have to be restarted
&gt; repeatedly if there are many subscribers.
&gt; 
&gt; [3] A combination of the two, using two stage events, where the first
&gt; stage generates a list of pending object/function pair calls. This would
&gt; allow each call to be handled atomically, but is far more complex.
&gt; 
&gt; I'm experimenting with #3 right now--anyone got any comments on the
&gt; subject?

I think the difference is mainly how much inconsitency you're willing to
tolerate.  It doesn't seem to me that [3] preserves the semantics of [2].  
In particular, two events might appear in different orders to different 
objects.  This may not be a problem if your world allows this--- 
serializability is overrated. :)  (and can still be enforced at a higher level
in the cases which really need it.)

There are ways to a avoid pessimal behavior in [2].  For example, increase
an event's "priority" each time it fails.  (J C Lawrence suggested
something like this in the "lockless system -- foolproof?" thread last year.)

Another hybrid scheme is to break large subscriptions into atomic
subsubscriptions of smaller size, grouped by "closeness".  The hope is that
objects that interact with each other will see a consistent event model,
while avoiding contention.  The bookkeeping necessary for this may tend
to make it not worthwhile--- and there's little real gain in what semantics
you may assume.

Does [3] really have to be implemented at the driver level?  It seems
identical in implementation to [1], except for the introduction of 
"subscription" objects.

-- 
Mark Gritter &lt;mgritter#cs,stanford.edu&gt;
<A  HREF="http://www-cs-students.stanford.edu/~mgritter/">http://www-cs-students.stanford.edu/~mgritter/</A>




_______________________________________________
MUD-Dev maillist  -  MUD-Dev#kanga,nu
<A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>


</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="00029" HREF="msg00029.html">Re: [MUD-Dev] dispatching events</A></strong>
<ul compact><li><em>From:</em> Greg Miller &lt;gmiller#classic-games,com&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00018" HREF="msg00018.html">[MUD-Dev] dispatching events</A></STRONG>
<UL><LI><EM>From:</EM> Greg Miller &lt;gmiller#classic-games,com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00023.html">Re: [MUD-Dev] Containing automation?</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00026.html">Re: [MUD-Dev] injury-based combat</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00018.html">[MUD-Dev] dispatching events</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00029.html">Re: [MUD-Dev] dispatching events</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00024"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00024"><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>Re: [MUD-Dev] mud vs. mush membership</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00077" HREF="msg00077.html">Re: [MUD-Dev] mud vs. mush membership</A></strong>, 
Adam Wiggins <a href="mailto:adam#angel,com">adam#angel,com</a>, Mon 02 Aug 1999, 23:50 GMT
</LI>
</ul>
</ul>
</ul>
<LI><strong><A NAME="00085" HREF="msg00085.html">[MUD-Dev] Mud Census?</A></strong>, 
Timothy O'Neill Dang <a href="mailto:timothy#nmia,com">timothy#nmia,com</a>, Wed 11 Aug 1999, 17:04 GMT
</LI>
</ul>
<LI><strong><A NAME="00074" HREF="msg00074.html">Re: [MUD-Dev] mud vs. mush membership</A></strong>, 
Bruce Mitchener, Jr. <a href="mailto:bruce#puremagic,com">bruce#puremagic,com</a>, Thu 29 Jul 1999, 23:43 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00018" HREF="msg00018.html">[MUD-Dev] dispatching events</A></strong>, 
Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Thu 22 Jul 1999, 17:13 GMT
<UL>
<LI><strong><A NAME="00024" HREF="msg00024.html">Re: [MUD-Dev] dispatching events</A></strong>, 
Mark Gritter <a href="mailto:mark#erdos,Stanford.EDU">mark#erdos,Stanford.EDU</a>, Thu 22 Jul 1999, 21:01 GMT
<UL>
<LI><strong><A NAME="00029" HREF="msg00029.html">Re: [MUD-Dev] dispatching events</A></strong>, 
Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Thu 22 Jul 1999, 21:38 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00016" HREF="msg00016.html">[MUD-Dev] injury-based combat</A></strong>, 
Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Thu 22 Jul 1999, 17:12 GMT
<UL>
<LI><strong><A NAME="00026" HREF="msg00026.html">Re: [MUD-Dev] injury-based combat</A></strong>, 
Brian Carter <a href="mailto:muddev#wyrms-of-malice,com">muddev#wyrms-of-malice,com</a>, Thu 22 Jul 1999, 21:03 GMT
<UL>
<LI><strong><A NAME="00028" HREF="msg00028.html">Re: [MUD-Dev] injury-based combat</A></strong>, 
Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Thu 22 Jul 1999, 21:38 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>