1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Event handling (was: request for comments) -->
<!--X-From-R13: f001tzhNabin.jevtug.rqh -->
<!--X-Date: Fri, 16 Jan 1998 15:35:11 +0000 -->
<!--X-Message-Id: Pine.PMDF.3.95.980116101935.543223882A&#45;100000#nova,wright.edu -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199801160431.UAA01090#under,Eng.Sun.COM -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Event handling (was: request for comments)</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:s001gmu#nova,wright.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="msg00245.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00247.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00245.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00195.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00246">Author</A>
&nbsp;|&nbsp;<A HREF="#00246">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00246">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Event handling (was: request for comments)</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>: Event handling (was: request for comments)</LI>
<LI><em>From</em>: <A HREF="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</A></LI>
<LI><em>Date</em>: Fri, 16 Jan 1998 10:35:36 -0500 (EST)</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, 15 Jan 1998, JC Lawrence wrote:

&gt; On Mon, 12 Jan 1998 07:43:01 PST8PDT 
&gt; s001gmu &lt;s001gmu#nova,wright.edu&gt; wrote:
&gt; 
&gt; &gt; On Sun, 11 Jan 1998, JC Lawrence wrote:

[...]

&gt; &gt;&gt; Certainly.  You create an event chain (as above) which iteratively
&gt; &gt;&gt; saps the character's strength and vitality.  Should that process
&gt; &gt;&gt; happen to kill the character (strength == 0?) then this will be
&gt; &gt;&gt; noticed by the normal methods of the character object (probably in
&gt; &gt;&gt; the accessor for the strength attribute) and processed from there.
&gt; 
&gt; &gt; As I understand it, the only difference is that he shortcuts the
&gt; &gt; event chain by having the running thread (process in his terms)
&gt; &gt; handle all of the delays by going to sleep, rather than scheduling a
&gt; &gt; new event to go off X ticks down the road.
 
[snip pros: easy interrupts ... ]

&gt; There is a significant implication in this system however.  It
&gt; effectively requires that you use a locking model, as to not use a
&gt; locking model would have most sleeping threads fail due to other more
&gt; rapidly commiting threads interfering with their data references.
&gt; Conversely, if you do go for a locking system the problem is then
&gt; preventing the system from bogging down to a worse-than serial
&gt; execution case as the events all contend and lock-wait for shared
&gt; data.

I disagree.  I don't see either as being implied.  As long as you don't
grab the lock (or the timestamp on the data for lockless), and then go to
sleep, you're fine.    Minimizing the critical section execution time is
the best way to avoid collisions, and putting a wait(), or sleep(), or
pthread_cond_wait() function call inside a critical section is.. well..
less than intelligent.  Release all locks, sleep, wake up, grab locks,
execute, release locks, go back to sleep.  For lockless, sleep, wakeup,
grab timestamp, execute, C&amp;C, sleep.  He would still have to imitate an
event chain, but would rather spend his time in a thread sleeping than on
a cpu scheduling events.

-Greg



</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00245" HREF="msg00245.html">Re: [MUD-Dev] Event handling (was: request for comments)</A></STRONG>
<UL><LI><EM>From:</EM> JC Lawrence &lt;claw#under,Eng.Sun.COM&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00245.html">Re: [MUD-Dev] Event handling (was: request for comments)</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00247.html">Re: [MUD-Dev]  The impact of the web on muds</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00245.html">Re: [MUD-Dev] Event handling (was: request for comments)</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00195.html">Re: [MUD-Dev] Event handling (was: request for comments)</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00246"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00246"><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] Event handling (was: request for comments)</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00198" HREF="msg00198.html">Re: [MUD-Dev] Event handling (was: request for comments)</A></strong>, 
JC Lawrence <a href="mailto:claw#under,Eng.Sun.COM">claw#under,Eng.Sun.COM</a>, Sun 11 Jan 1998, 21:09 GMT
<LI><strong><A NAME="00209" HREF="msg00209.html">Event handling (was: request for comments)</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Mon 12 Jan 1998, 14:41 GMT
<LI><strong><A NAME="00222" HREF="msg00222.html">[MUD-Dev]  Event handling - some definitions</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Tue 13 Jan 1998, 00:55 GMT
</LI>
<LI><strong><A NAME="00245" HREF="msg00245.html">Re: [MUD-Dev] Event handling (was: request for comments)</A></strong>, 
JC Lawrence <a href="mailto:claw#under,Eng.Sun.COM">claw#under,Eng.Sun.COM</a>, Fri 16 Jan 1998, 04:31 GMT
<LI><strong><A NAME="00246" HREF="msg00246.html">Event handling (was: request for comments)</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Fri 16 Jan 1998, 15:35 GMT
</LI>
</LI>
</LI>
</LI>
</ul>
<LI><strong><A NAME="00195" HREF="msg00195.html">Re: [MUD-Dev] Event handling (was: request for comments)</A></strong>, 
JC Lawrence <a href="mailto:claw#under,Eng.Sun.COM">claw#under,Eng.Sun.COM</a>, Sun 11 Jan 1998, 20:44 GMT
<UL>
<LI><strong><A NAME="00207" HREF="msg00207.html">Re: [MUD-Dev] Event handling (was: request for comments)</A></strong>, 
Matt Chatterley <a href="mailto:root#mpc,dyn.ml.org">root#mpc,dyn.ml.org</a>, Mon 12 Jan 1998, 10:02 GMT
</LI>
<LI><strong><A NAME="00210" HREF="msg00210.html">Event handling (was: request for comments)</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Mon 12 Jan 1998, 15:13 GMT
</LI>
<LI><strong><A NAME="00220" HREF="msg00220.html">Event handling (was: request for comments)</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Mon 12 Jan 1998, 22:12 GMT
</LI>
</UL>
</LI>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</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>