<!-- MHonArc v2.4.4 --> <!--X-Subject: Re: [MUD-Dev] Event handling (was: request for comments) --> <!--X-From-R13: XQ Znjerapr <pynjNhaqre.Sat.Eha.QA[> --> <!--X-Date: Fri, 16 Jan 1998 04:31:50 +0000 --> <!--X-Message-Id: 199801160431.UAA01090#under,Eng.Sun.COM --> <!--X-Content-Type: text/plain --> <!--X-Reference: Pine.PMDF.3.95.980112092757.543169343A-100000#nova,wright.edu --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, Re: [MUD-Dev] Event handling (was: request for comments)</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:claw#under,Eng.Sun.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> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00244.html">Previous</a> | <a href="msg00246.html">Next</a> ] Thread: [ <a href="msg00222.html">Previous</a> | <a href="msg00246.html">Next</a> ] Index: [ <A HREF="author.html#00245">Author</A> | <A HREF="#00245">Date</A> | <A HREF="thread.html#00245">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>Re: [MUD-Dev] 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>: Re: [MUD-Dev] Event handling (was: request for comments) </LI> <LI><em>From</em>: JC Lawrence <<A HREF="mailto:claw#under,Eng.Sun.COM">claw#under,Eng.Sun.COM</A>></LI> <LI><em>Date</em>: Thu, 15 Jan 1998 20:31:41 -0800</LI> <LI><em>cc</em>: <A HREF="mailto:claw#null,net">claw#null,net</A></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> On Mon, 12 Jan 1998 07:43:01 PST8PDT s001gmu <s001gmu#nova,wright.edu> wrote: > On Sun, 11 Jan 1998, JC Lawrence wrote: >> Note: "event" is actually a very poor term for what we are >> describing here. They really aren't events, but I'm unsure of a >> better name for them. > Actions? Hurm. Not bad. >> Certainly. You create an event chain (as above) which iteratively >> saps the character's strength and vitality. Should that process >> happen to kill the character (strength == 0?) then this will be >> noticed by the normal methods of the character object (probably in >> the accessor for the strength attribute) and processed from there. > As I understand it, the only difference is that he shortcuts the > event chain by having the running thread (process in his terms) > handle all of the delays by going to sleep, rather than scheduling a > new event to go off X ticks down the road. > There are some advantages to doing it that way... You can have the > thread sleep by using pthread_cond_timedwait (assuming you are using > posix threads) , and use the condition var as an interrupt signal, > allowing for very gracefull interruption and interrupt handling. If > you want to interrupt a pending event in an event queue, you have to > search the queue, or have some kludgy structure imposed above the > queue to allow for easier access, etc. There is a significant implication in this system however. It effectively requires that you use a locking model, as to not use a locking model would have most sleeping threads fail due to other more rapidly commiting threads interfering with their data references. Conversely, if you do go for a locking system the problem is then preventing the system from bogging down to a worse-than serial execution case as the events all contend and lock-wait for shared data. -- J C Lawrence Internet: claw#null,net Internet: coder#ibm,net ----------(*) Internet: jc.lawrence#sun,com ...Honourary Member of 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="00246" HREF="msg00246.html">Event handling (was: request for comments)</A></strong> <ul compact><li><em>From:</em> s001gmu#nova,wright.edu</li></ul> </UL></LI></UL> <!--X-Follow-Ups-End--> <!--X-References--> <UL><LI><STRONG>References</STRONG>: <UL> <LI><STRONG><A NAME="00209" HREF="msg00209.html">Event handling (was: request for comments)</A></STRONG> <UL><LI><EM>From:</EM> s001gmu#nova,wright.edu</LI></UL></LI> </UL></LI></UL> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00244.html">Re: [MUD-Dev] OT: Insane Wordwrapping</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00246.html">Event handling (was: request for comments)</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00222.html">[MUD-Dev] Event handling - some definitions</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00246.html">Event handling (was: request for comments)</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00245"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00245"><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> <LI><strong><A NAME="00155" HREF="msg00155.html">Re: [MUD-Dev] Event handling (was: request for comments)</A></strong>, Vadim Tkachenko <a href="mailto:vadimt#4cs,com">vadimt#4cs,com</a>, Fri 09 Jan 1998, 23:03 GMT <UL> <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> <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> </UL> </LI> </ul> </ul> </ul> </ul> </ul> </ul> </ul> </ul> </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>