<!-- MHonArc v2.4.4 --> <!--X-Subject: [MUD-Dev] Re: DevMUD: Inheritable modules --> <!--X-From-R13: Quevf Uenl <ptNnzv-pt.UenlEntr.Sqzbagba.OP.QO> --> <!--X-Date: Sat, 31 Oct 1998 13:23:52 -0800 --> <!--X-Message-Id: 199810311830.LAA05630@ami-cg.GraySage.Edmonton.AB.CA --> <!--X-Content-Type: text/plain --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, [MUD-Dev] Re: DevMUD: Inheritable modules</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA"> </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="msg00644.html">Previous</a> | <a href="msg00646.html">Next</a> ] Thread: [ <a href="msg00644.html">Previous</a> | <a href="msg00662.html">Next</a> ] Index: [ <A HREF="author.html#00645">Author</A> | <A HREF="#00645">Date</A> | <A HREF="thread.html#00645">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>[MUD-Dev] Re: DevMUD: Inheritable modules</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>: [MUD-Dev] Re: DevMUD: Inheritable modules</LI> <LI><em>From</em>: Chris Gray <<A HREF="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</A>></LI> <LI><em>Date</em>: Sat, 31 Oct 1998 11:30:57 -0700</LI> <LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#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> [Jon A. Lambert:] >Why couldn't each module implement it's own desired level of >threading. The loader would dynamically load the module and then >start it running using a createthread(), startthread() mechanism. >Each module then starts as a single thread. The module writer need >not even be concerned that they are threaded. Since there seems to be >agreement that a common module interface is necessary, why not make >that small bit of common inter-module interface code thread-safe by >issuing the necessary locking mechanisms within the interface wrapper >itself. I'm not too fond of having a thread for every module. Personally, I think we might need to classify modules according to how they participate in things. For example, a module that is a source of input lines can run the processing of the input line in a thread (perhaps using some scheme to control the total number of active threads to a reasonable value). If it then calls an entry in a parsing interface to handle that input line, that handling can continue in the same thread throughout. Similarly, if the parsing requires database access, that very same thread can go through into a DB module. If the DB module needs to do disk I/O to retrieve the needed value, then it is that thread that sleeps, waiting for it. (A DB module is one that could readily have its own thread, to do background flushing, compressing, whatever.) So, I would like to see all modules be thread safe, but not necessarily setup to have a thread of their own. I guess that could be done with the scheme you are suggesting, by just having the main thread for some modules just exit right away - that module is then only active when its interfaces are called upon. That seems a bit backwards to me, however - I think if a module needs threads, it should create them in its module initialization function (or whenever else is appropriate for it). We could provide some support in the "core" for thread creation, etc., but the native routines seem to be all pretty straightforward anyway. Thread-switches are not as expensive as process switches, but they are likely at least 10 times more expensive than a function call. -- Don't design inefficiency in - it'll happen in the implementation. - me Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <!--X-Follow-Ups-End--> <!--X-References--> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg00644.html">[MUD-Dev] Re: DevMUD: Inheritable modules</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg00646.html">[MUD-Dev] Re: MUD-Dev's DevMUD: a word of caution</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg00644.html">[MUD-Dev] Re: DevMUD: Inheritable modules</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg00662.html">[MUD-Dev] Re: DevMUD: Inheritable modules</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#00645"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#00645"><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>[MUD-Dev] Re: DevMUD: Inheritable modules</STRONG>, <EM>(continued)</EM> <ul compact> <LI><strong><A NAME="00621" HREF="msg00621.html">[MUD-Dev] Re: DevMUD: Inheritable modules</A></strong>, Cynbe ru Taren <a href="mailto:cynbe#muq,org">cynbe#muq,org</a>, Sat 31 Oct 1998, 07:50 GMT <UL> <LI><strong><A NAME="00657" HREF="msg00657.html">[MUD-Dev] Re: DevMUD: Inheritable modules</A></strong>, Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sun 01 Nov 1998, 04:02 GMT </LI> </UL> </LI> <LI><strong><A NAME="00639" HREF="msg00639.html">[MUD-Dev] Re: DevMUD: Inheritable modules</A></strong>, Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 31 Oct 1998, 21:22 GMT </LI> <LI><strong><A NAME="00644" HREF="msg00644.html">[MUD-Dev] Re: DevMUD: Inheritable modules</A></strong>, Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 31 Oct 1998, 21:23 GMT </LI> <LI><strong><A NAME="00645" HREF="msg00645.html">[MUD-Dev] Re: DevMUD: Inheritable modules</A></strong>, Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 31 Oct 1998, 21:23 GMT </LI> <LI><strong><A NAME="00662" HREF="msg00662.html">[MUD-Dev] Re: DevMUD: Inheritable modules</A></strong>, Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sun 01 Nov 1998, 06:01 GMT </LI> <LI><strong><A NAME="00699" HREF="msg00699.html">[MUD-Dev] Re: DevMUD: Inheritable modules</A></strong>, Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Tue 03 Nov 1998, 04:26 GMT <UL> <LI><strong><A NAME="00703" HREF="msg00703.html">[MUD-Dev] Re: DevMUD: Inheritable modules</A></strong>, James Wilson <a href="mailto:jwilson#rochester,rr.com">jwilson#rochester,rr.com</a>, Tue 03 Nov 1998, 04:59 GMT </LI> </UL> </LI> </ul> </LI> <LI><strong><A NAME="00570" HREF="msg00570.html">[MUD-Dev] DevMUD: Inheritable modules</A></strong>, The Arrow <a href="mailto:arrow#trelleborg,mail.telia.com">arrow#trelleborg,mail.telia.com</a>, Wed 28 Oct 1998, 18:23 GMT </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>