1997Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]  C&#38;C and Event Rescheduling -->
<!--X-From-R13: Eunja Vnycraal <znynpunvNvanzr.pbz> -->
<!--X-Date: from scipio.globecomm.net [207.51.48.12] by in10.ibm.net id 869850857.41174&#45;1 Fri Jul 25 17:14:17 1997 CUT -->
<!--X-Message-Id: 33D8DED4.41C67EA6#iname,com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199707250116.SAA26123#xsvr3,cup.hp.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: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="msg00241.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00243.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00235.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00278.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00242">Author</A>
&nbsp;|&nbsp;<A HREF="#00242">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00242">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>: Shawn Halpenny &lt;<A HREF="mailto:malachai#iname,com">malachai#iname,com</A>&gt;</LI>
<LI><em>Date</em>: Fri, 25 Jul 1997 13:13:57 -0400</LI>
<LI><em>Sender</em>: <A HREF="mailto:rsh#iname,com">rsh#iname,com</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
clawrenc#cup,hp.com wrote:
&gt; 
&gt; In &lt;<A HREF="msg00228.html">33D63D8C.167EB0E7#iname,com</A>&gt;, on 07/23/97
&gt;    at 09:53 PM, Shawn Halpenny &lt;malachai#iname,com&gt; said:

[ determining object has changed during event execution ]

&gt; &gt;Right now, my design is to just do a bitwise comparison just like
&gt; &gt;above, but I'm also thinking of something involving an object
&gt; &gt;checksum of sorts computed when an object is committed.
&gt; 
&gt; A simple approach (oustide of disk space) is to expand your object
&gt; definition to also enclude a time stamp of the last change.  This can
&gt; be a nanosecond clock or a time_t.  If different the objects fail C&amp;C.
&gt; If the same, *then* do the bit comparison when they're the same.

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

I'm still considering individual attribute comparisons, but still have some
cases to work out.

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

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

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

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

[ example elided ]

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

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

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

But the event that is being killed and rescheduled is active when the
C&amp;C fails in the case where other events have to be notified that an
object they were using has changed.  Those events get the exception. 
I'm not quite happy with this either...I think I can tie it to my
notification stuff below (which is similar to your flags above) and
make it simpler (and uniform) overall.

&gt; &gt;&gt; Concern:
&gt; &gt;&gt;
&gt; &gt;&gt;   An event generated IO.  How do you handle when it reschedules?
&gt; &gt;&gt; Think about things like SAY, TELL, LOOK, etc for example cases.
&gt; 
&gt; &gt;As of yet, I don't.  In the last few weeks I've been doing the
&gt; &gt;"formal" design of the base systems (network, DB, event handling).
&gt; 
&gt; Handling IO is a pretty big part of any server design.

Yes, yes...I just haven't got to it yet.  I'm still working the DB
and event interactions into something generic enough that when I tie in the
I/O I hopefully won't have (many) problems.

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

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

[ events implementing channel verbs ]

&gt; &gt;At the moment, I'm thinking along the lines
&gt; &gt;of the "tell" verb posting an event for each receiving player, rather
&gt; &gt;than a root object to handle it.
&gt; 
&gt; Largely there's no semantic difference.  The trick is to not have an
&gt; event which is dependant on successfully iterating the entire player
&gt; base (or any group object classification for that matter) within a
&gt; single event.  If you do that it will rarely successfully C&amp;C and the
&gt; player objects change.
&gt; 
&gt; Another side effect of the same problem:
&gt; 
&gt;   How do you handle broadcasting state changes to other objects?

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

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

-- 
Shawn Halpenny

"You can't buy the necessities of life with cookies"
                                    - "Edward Scissorhands"

</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="00278" HREF="msg00278.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></strong>
<ul compact><li><em>From:</em> clawrenc#cup,hp.com</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00235" HREF="msg00235.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></STRONG>
<UL><LI><EM>From:</EM> clawrenc#cup,hp.com</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00241.html">Re: [MUD-Dev] Multi-threaded programming under Linux</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00243.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00235.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00278.html">Re: [MUD-Dev]  C&amp;C and Event Rescheduling</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00242"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00242"><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>
<LI><strong><A NAME="00200" HREF="msg00200.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 19 Jul 1997, 03:13 GMT
<UL>
<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>
</LI>
</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>
</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>