1997Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]  C&#38;C and Event Rescheduling -->
<!--X-From-R13: pynjerapNphc.uc.pbz -->
<!--X-Date: from fabius.globecomm.net [207.51.48.6] by in1.ibm.net id 870217767.21286&#45;1 Tue Jul 29 23:09:27 1997 CUT -->
<!--X-Message-Id: 199707292308.QAA17253#xsvr3,cup.hp.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 33D8DED4.41C67EA6#iname,com -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev]  C&amp;C and Event Rescheduling</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:clawrenc#cup,hp.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="msg00242.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00294.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>Re: [MUD-Dev]  C&amp;C and Event Rescheduling</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev]  C&amp;C and Event Rescheduling</LI>
<LI><em>From</em>: <A HREF="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</A></LI>
<LI><em>Date</em>: Tue, 29 Jul 97 15:54:08 -0700</LI>
<LI><em>Reply-to</em>: <A HREF="mailto:claw#null,net">claw#null,net</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 &lt;<A HREF="msg00242.html">33D8DED4.41C67EA6#iname,com</A>&gt;, on 07/25/97 
   at 10:15 AM, Shawn Halpenny &lt;malachai#iname,com&gt; said:

&gt;clawrenc#cup,hp.com wrote:

&gt;&gt; In &lt;<A HREF="msg00228.html">33D63D8C.167EB0E7#iname,com</A>&gt;, on 07/23/97
&gt;&gt;    at 09:53 PM, Shawn Halpenny &lt;malachai#iname,com&gt; said:

&gt;[ determining object has changed during event execution ]

&gt;Yes.  While pondering this stuff yesterday I'd thought about a
&gt;counter that keeps track of the number of attribute-writes for that
&gt;object.  Should it have changed by the time the next commit comes
&gt;around, then do a comparison (actually, if the count is different,
&gt;isn't it safe to assume that _some_ attribute was changed, therefore
&gt;don't do a comparison at all?)

Yup, and this would be more efficient than my suggestions.

&gt;&gt; &gt;Do your
&gt;&gt; &gt;events keep track of the attributes they touch or is that handled
&gt;&gt; &gt;entirely by the DB?
&gt;&gt; 
&gt;&gt; This is currently in a mess.  Actually that's an understatement.  I'm
&gt;&gt; partially dug into Arjuna to use it as a persistant store.  Part and
&gt;&gt; parcel of this idea would be devolving MUD objects at the storage into
&gt;&gt; individual objects, one each per attribute and method.  Its then a
&gt;&gt; simple matter of flagging the references at runtime to resolve what
&gt;&gt; bits got checked/changed ans what didn't.

&gt;I've taken a cursory look at Arjuna, but I'm not sure that I'm
&gt;comfortable with every object being stored in its own file (doesn't
&gt;that turn into a linear search for an object, given its ID?).  It
&gt;seems to be a well-designed piece of software, though.

They use individual files per object type.  I forget how they do
indexing, but it didn't seem *too* bad.  I was (its been a while since
I've had a chance to look at them) however very concerned with their
pessimal cacheing.

&gt;Making each attribute and method into an object is interesting.  It
&gt;would certainly simplify C&amp;C, since there's no longer a need for
&gt;attribute checking.  Have to look into that.

Nahh, I'd still do attribute checking -- only I'd only check the
attribute that were referenced or changed.  Thus the contention is
devolved down to the individual attributes on objects.  This doesn't
help the worst case (50 players decide to move from room A to room B),
but it should help with the majority of contentions.

&gt;&gt; &gt;Is there a problem with a situation where a
&gt;&gt; &gt;single object with attributes touched by two events within the
&gt;&gt; &gt;duration of a third event using the same object could cause some
&gt;&gt; &gt;attributes touched by the third event to falsely pass the comparison?
&gt;&gt; 
&gt;&gt; Yes, but I don't consider this a problem:

&gt;[ example elided ]

&gt;&gt; Logically interesting I'll admit, but not a problem that I can see.

&gt;True, not a problem and interesting as you say.  For some reason it
&gt;bothers me, though, but is probably something I could live with (and
&gt;wouldn't have to consider if I counted commits or attribute changes).

It bothered me until I admitted to myself that I couldn't think of a
negative impact.

&gt;&gt; &gt;&gt;   Re: #7.  Similarly I post messages (flags really) to all the members
&gt;&gt; &gt;&gt; of the interested parties lists for all the objects that a
&gt;&gt; &gt;&gt; successfully committed transaction modified.  The effect of those
&gt;&gt; &gt;&gt; flags is that the next time those events traverse a block boundary
&gt;&gt; &gt;&gt; (essentially any piece of code wrapped in {braces}, such as entering
&gt;&gt; &gt;&gt; or leaving an IF, or WHILE etc), the flag gets checked and if TRUE,
&gt;&gt; &gt;&gt; the event aborts to reschedule.
&gt;&gt; 
&gt;&gt; &gt;I do much the same, using the exception mechanism of the internal
&gt;&gt; &gt;language.
&gt;&gt; 
&gt;&gt; I explicitly didn't put this in the language exceptions as once an
&gt;&gt; event compleats and attempts C&amp;C there' no language running to receive
&gt;&gt; the exception.  A new event would have to be started to catch the
&gt;&gt; exception...

&gt;But the event that is being killed and rescheduled is active when the
&gt;C&amp;C fails...

Not for me.  The event is done and cleared out.  It is *gone*.  The
Executor then signals the dispatchor that it wants to C&amp;C, get the
pass/fail on the C&amp;C and proceeds accordingly.

&gt;...in the case where other events have to be notified that an
&gt;object they were using has changed.  

That's handled by the DB which alsready maintains the interested party
lists.  After all, its the only one who knows who has what.

&gt;Those events get the exception. 

I guess I could do this, but my exception code really isn't built for
it and its also a waste of processing.  Why have the stack unwind when
you already know that the event is going to C&amp;C?  I have the executor
order the executing thread to kill and flush the event, and then it
prepares for the next event off the queue.  Boom!  Its dead, gone, and
the next one is being processed.  The event itself doesn't care -- it
will get rescheduled, and it caused no permanent effeects (it never
C&amp;C'ed), so there are no costs or side-effects to slaughtering it
outright.  The VM for the event has no permanence, so it just resets
to initial state and awaits the next event off the queue..

&gt;I'm not quite happy with this either...I think I can tie it to my
&gt;notification stuff below (which is similar to your flags above) and
&gt;make it simpler (and uniform) overall.

I'm interested.

&gt;&gt; Consider:
&gt;&gt; 
&gt;&gt;   Player A types, "get axe".
&gt;&gt; 
&gt;&gt;   Event 1 runs the "get axe" code.
&gt;&gt; 
&gt;&gt;   Event 1 issues the IO, "You pick up the axe." back to the player.
&gt;&gt; 
&gt;&gt;   Player B picks up the axe.  This event sucessfully commits.
&gt;&gt; 
&gt;&gt;   Event 1 then tries to C&amp;C, fails, reschedules, and pops back with
&gt;&gt; "What axe?"
&gt;&gt; 
&gt;&gt;   Meanwhile the player A sees:
&gt;&gt; 
&gt;&gt;     &gt; get axe
&gt;&gt;     You pick up the axe.
&gt;&gt;     B picks up the axe.
&gt;&gt;     What axe?
&gt;&gt;     &gt; i
&gt;&gt;     ...no axe...
&gt;&gt; 
&gt;&gt; &gt;Handling commands where events that have to touch a number of objects
&gt;&gt; &gt;that have likely changed by the time the event is processed isn't
&gt;&gt; &gt;something I've worked on yet.  Therein lies the difficulty.
&gt;&gt; 
&gt;&gt; Its worth attention.

&gt;Yep.  Haven't got to it yet.  Current thinking:  output should be
&gt;queued and then displayed when the event successfully commits, or
&gt;displayed immediately when a condition necessary for a successful
&gt;commit fails (i.e.  someone already picked up the axe).

I buffer all IO and release only upon successful commit.  If it never
commits, it never releases the IO.

&gt;&gt;   How do you handle broadcasting state changes to other objects?

&gt;The following is my first take on this, since until this point I had
&gt;only said that there needs to be some way of notifying other objects
&gt;of state changes:

&gt;Post an event to call the notification method on each interested
&gt;object. 

How do you know who is interested?  Where is that data maintained, and
how does it get there?  Does the notification enclude what changed, or
just that there was a change?

&gt;Only a single instance of this method needs to be running at
&gt;a time, since the event will now handle further state changes by way
&gt;of the C&amp;C mechanism and thus keep retrying the notification code
&gt;until it completes.  So, the event is only posted if the notification
&gt;method that is called is not already being executed (this is
&gt;maintained by a bit in a bit field within the object).

What about if an object has watches on multiple other objects?

-- 
J C Lawrence                           Internet: claw#null,net
(Contractor)                           Internet: coder#ibm,net
---------------(*)               Internet: clawrenc#cup,hp.com
...Honorary Member Clan McFUD -- Teamer's Avenging Monolith...


</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="00294" HREF="msg00294.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></strong>
<ul compact><li><em>From:</em> Shawn Halpenny &lt;malachai#iname,com&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00242" HREF="msg00242.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></STRONG>
<UL><LI><EM>From:</EM> Shawn Halpenny &lt;malachai#iname,com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00277.html">Dynamic Descriptions</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00279.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00242.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00294.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</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>Re: [MUD-Dev]  C&amp;C and Event Rescheduling</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00204" HREF="msg00204.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Sat 19 Jul 1997, 07:26 GMT
<UL>
<LI><strong><A NAME="00228" HREF="msg00228.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></strong>, 
Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Thu 24 Jul 1997, 00:21 GMT
<UL>
<LI><strong><A NAME="00235" HREF="msg00235.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Fri 25 Jul 1997, 08:17 GMT
<UL>
<LI><strong><A NAME="00242" HREF="msg00242.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></strong>, 
Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Sat 26 Jul 1997, 00:14 GMT
<UL>
<LI><strong><A NAME="00278" HREF="msg00278.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Wed 30 Jul 1997, 06:09 GMT
<UL>
<LI><strong><A NAME="00294" HREF="msg00294.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></strong>, 
Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Thu 31 Jul 1997, 02:32 GMT
<UL>
<LI><strong><A NAME="00466" HREF="msg00466.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Mon 11 Aug 1997, 20:49 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</ul>
</ul>
<LI><strong><A NAME="00291" HREF="msg00291.html">C&amp;C and Event Rescheduling</A></strong>, 
Miroslav Silovic <a href="mailto:silovic#petra,zesoi.fer.hr">silovic#petra,zesoi.fer.hr</a>, Wed 30 Jul 1997, 22:35 GMT
</LI>
<LI><strong><A NAME="00312" HREF="msg00312.html">C&amp;C and Event Rescheduling</A></strong>, 
Miroslav Silovic <a href="mailto:silovic#mare,zesoi.fer.hr">silovic#mare,zesoi.fer.hr</a>, Thu 31 Jul 1997, 23:09 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>