msg00273.html
1999Q2/msg00273.html · 9.4 KB
From the archive 1999Q2.zip
Download the archive « Back to the archive contents
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD-Dev] Multi-threaded mud server. -->
<!--X-From-R13: Qnyvona Fverfvnf Rnexybpx <pnyvonaNqnexybpx.pbz> -->
<!--X-Date: Sun, 16 May 1999 20:48:47 -0700 -->
<!--X-Message-Id: 4.1.19990516165255.00a48770#pop,darklock.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: Pine.LNX.4.10.9905162033590.4142-100000@drpc-jrn.res.st-and.ac.uk -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Multi-threaded mud server.</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:caliban#darklock,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="msg00272.html">Previous</a>
| <a href="msg00274.html">Next</a>
]
Thread:
[ <a href="msg00270.html">Previous</a>
| <a href="msg00277.html">Next</a>
]
Index:
[ <A HREF="author.html#00273">Author</A>
| <A HREF="#00273">Date</A>
| <A HREF="thread.html#00273">Thread</A>
]
<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Multi-threaded mud server.</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>: Re: [MUD-Dev] Multi-threaded mud server.</LI>
<LI><em>From</em>: Caliban Tiresias Darklock <<A HREF="mailto:caliban#darklock,com">caliban#darklock,com</A>></LI>
<LI><em>Date</em>: Sun, 16 May 1999 17:58:04 -0700</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#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>
On 08:42 PM 5/16/99 +0000, I personally witnessed Ross Nicoll jumping up to
say:
>
>The MUD creates as many threads as processors, and then allocates players
>and computer characters in such a way that load on each processor should
>be roughly equal. This should keep context switching to a minimum.
Maybe I don't understand context switching -- my understanding of threads
is minimal -- but this sounds fallacious. As I understand it, context
switching is when one thread gives way to another thread, which means its
state (context) needs to be saved and the other's has to be restored
(switching).
So if you have two players online, each with one character, each on a
different thread of a multiprocessor machine, and they have a conversation
-- don't you have to context switch twice with every statement? The current
player says something, which needs to go to the other player, so you
context-switch to the other thread to talk to player two, send him the
information, and then tell the original thread that you completed the
action successfully, which is yet *another* context switch. So your context
switching immediately goes through the roof, doesn't it?
If I'm correct in this understanding, and please correct me if I'm not,
then the "proper" way to implement such a scheme would be for each thread
to accomplish specific *tasks* instead of handling specific *objects*. So
instead of a series of "do things with an object" threads, you would have a
series of "do this thing" threads -- and those which are rarely if ever
called can be shut down entirely after a given period. For example, you
might have a "login" thread which handles everyone connected but not logged
in, a thread which handles combat, a thread which handles character
creation, etc.
Ideally, you would set this up so most of your common operations are in the
same thread, while progressively less common actions get separated out into
threads which can be put to sleep entirely when they're not needed. A login
thread, for example, only needs to be active when someone is sitting at the
main login screen to log in; if there are long periods during which no one
logs in, the thread can be put to sleep during those times.
A related thought (and the one I'm still considering) would be a thread for
each area. When no one is in area X, that area can be safely unloaded from
memory; thus, with five players online, you don't need to have eighty areas
loaded. Just five, at most. All the other threads can be halted altogether.
-----
| Caliban Tiresias Darklock caliban#darklock,com
| Darklock Communications <A HREF="http://www.darklock.com/">http://www.darklock.com/</A>
| U L T I M A T E U N I V E R S E I S N O T D E A D
| 774577496C6C6E457645727355626D4974H -=CABAL::3146=-
_______________________________________________
MUD-Dev maillist - MUD-Dev#kanga,nu
<A HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>
</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="00307" HREF="msg00307.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>
<ul compact><li><em>From:</em> Ola Fosheim Grøstad <olag#ifi,uio.no></li></ul>
<li><strong><A NAME="00283" HREF="msg00283.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>
<ul compact><li><em>From:</em> "Jon A. Lambert" <jlsysinc#ix,netcom.com></li></ul>
<li><strong><A NAME="00277" HREF="msg00277.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>
<ul compact><li><em>From:</em> Ross Nicoll <rnicoll#lostics,demon.co.uk></li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00270" HREF="msg00270.html">[MUD-Dev] Multi-threaded mud server.</A></STRONG>
<UL><LI><EM>From:</EM> Ross Nicoll <rnicoll#lostics,demon.co.uk></LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00272.html">Re: [MUD-Dev] Sockets</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00274.html">RE: [MUD-Dev] Marc Hernandez' Server</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00270.html">[MUD-Dev] Multi-threaded mud server.</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00277.html">Re: [MUD-Dev] Multi-threaded mud server.</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00273"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00273"><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] Kanga.Nu has finally moved...</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00318" HREF="msg00318.html">[MUD-Dev] Kanga.Nu has finally moved...</A></strong>,
claw <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Thu 20 May 1999, 06:55 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00309" HREF="msg00309.html">Re: [MUD-Dev] Noise: boys will be boys (was Re: [MUD-Dev] Multi-threaded mud server.)</A></strong>,
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 20 May 1999, 05:10 GMT
<UL>
<li><Possible follow-up(s)><br>
<LI><strong><A NAME="00312" HREF="msg00312.html">RE: [MUD-Dev] Noise: boys will be boys (was Re: [MUD-Dev] Multi-threaded mud server.)</A></strong>,
Koster, Raph <a href="mailto:rkoster#origin,ea.com">rkoster#origin,ea.com</a>, Thu 20 May 1999, 05:13 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00270" HREF="msg00270.html">[MUD-Dev] Multi-threaded mud server.</A></strong>,
Ross Nicoll <a href="mailto:rnicoll#lostics,demon.co.uk">rnicoll#lostics,demon.co.uk</a>, Sun 16 May 1999, 21:09 GMT
<UL>
<LI><strong><A NAME="00273" HREF="msg00273.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>,
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Mon 17 May 1999, 03:48 GMT
<UL>
<LI><strong><A NAME="00277" HREF="msg00277.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>,
Ross Nicoll <a href="mailto:rnicoll#lostics,demon.co.uk">rnicoll#lostics,demon.co.uk</a>, Mon 17 May 1999, 04:22 GMT
<UL>
<LI><strong><A NAME="00280" HREF="msg00280.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>,
Travis S. Casey <a href="mailto:efindel#io,com">efindel#io,com</a>, Mon 17 May 1999, 15:24 GMT
<UL>
<LI><strong><A NAME="00298" HREF="msg00298.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>,
Ola Fosheim Grøstad <a href="mailto:no#no,no">no#no,no</a>, Tue 18 May 1999, 06:44 GMT
</LI>
<LI><strong><A NAME="00339" HREF="msg00339.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>,
Ross Nicoll <a href="mailto:rnicoll#lostics,demon.co.uk">rnicoll#lostics,demon.co.uk</a>, Fri 28 May 1999, 21:04 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</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>