1999Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Multi&#45;threaded mud server. -->
<!--X-From-R13: "Fenivf E. Qnfrl" <rsvaqryNvb.pbz> -->
<!--X-Date: Tue, 18 May 1999 21:47:23 &#45;0700 -->
<!--X-Message-Id: Pine.BSF.4.05.9905181425440.4520&#45;100000#schultz,io.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 19990517170954.A24820#thelonious,new.ox.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:efindel#io,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="msg00307.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00309.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00302.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00315.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00308">Author</A>
&nbsp;|&nbsp;<A HREF="#00308">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00308">Thread</A>
&nbsp;]

<!--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>: "Travis S. Casey" &lt;<A HREF="mailto:efindel#io,com">efindel#io,com</A>&gt;</LI>
<LI><em>Date</em>: Tue, 18 May 1999 14:34:12 -0500 (CDT)</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 Mon, 17 May 1999, Jo Dillon wrote:
&gt; Jon A. Lambert (jlsysinc#ix,netcom.com) spake thusly:

&gt; &gt; There exists a 400 mhz Pentium II single-processor with 64 Mb of memory 
&gt; &gt; running Redhat Linux.  Running on the server is ftpd, httpd, telnetd,
&gt; &gt; smptd, dns, a stock Diku mud server, a DGD LP mud server, and a ColdMUD 
&gt; &gt; server.  The server is probably underloaded.   
&gt; &gt; 
&gt; &gt; Is there context switching going on here?  YES! Loads and loads of the 
&gt; &gt; "expensive" process-level context switching.  
&gt; &gt; 
&gt; &gt; &lt;rant&gt;
&gt; &gt; Now suppose I wish to redesign and multi-thread that Diku mud server.  
&gt; &gt; Why would I WORRY about the overhead of "cheaper" thread-level context 
&gt; &gt; switching?
&gt; &gt; Why should I CARE at the application-level how many processors are 
&gt; &gt; present on the friggin box!?!@#!??
&gt; &gt; &lt;/rant&gt;
&gt; 
&gt;   Isn't the point that every time you context switch you invalidate the
&gt; cache (since the new thread of execution will be in a different chunk of
&gt; memory to the old one), and therefore if you have more threads than 
&gt; processors you context-switch &lt;bignum&gt; times a second, therefore constantly 
&gt; invalidating your cache and giving yourself a big speed hit?

Watch out for that term "the cache."  Systems and OS's have many different
caches and things that can be considered caches.

In this case, there are two caches that are likely to be invalidated --
the TLB and the processor's instruction cache.  However, how much of an
impact this will have depends on what your machine's memory access time is
relative to the CPU speed (which may depend on what other caches there
are) and the amount of time you spend in each thread.

It also depends on the design of the processor -- some processors have
multiple sets of registers to help with context switching.  I don't know
off-hand if any have multiple instruction caches and/or TLBs, but I don't
see any reason why those wouldn't be possible.

In practical terms, the speed hit may not be very big, especially
considering that most muds are going to spend a lot of their time waiting
on the network.  Ultimately, though, the only way you can really know what
effect it will have on a given machine is to try it and see.

--
       |\      _,,,---,,_        Travis S. Casey  &lt;efindel#io,com&gt;
 ZZzz  /,`.-'`'    -.  ;-;;,_   No one agrees with me.  Not even me.
      |,4-  ) )-,_..;\ (  `'-'
     '---''(_/--'  `-'\_) 



_______________________________________________
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>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00302" HREF="msg00302.html">Re: [MUD-Dev] Multi-threaded mud server.</A></STRONG>
<UL><LI><EM>From:</EM> Jo Dillon &lt;emily#thelonious,new.ox.ac.uk&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00307.html">Re: [MUD-Dev] Multi-threaded mud server.</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00309.html">Re: [MUD-Dev] Noise: boys will be boys (was Re: [MUD-Dev] Multi-threaded mud server.)</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00302.html">Re: [MUD-Dev] Multi-threaded mud server.</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00315.html">Re: [MUD-Dev] Multi-threaded mud server.</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00308"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00308"><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] Multi-threaded mud server.</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00294" HREF="msg00294.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>, Tue 18 May 1999, 06:42 GMT
</LI>
</ul>
</ul>
<LI><strong><A NAME="00283" HREF="msg00283.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Mon 17 May 1999, 15:45 GMT
<UL>
<LI><strong><A NAME="00301" HREF="msg00301.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>, 
Mik Clarke <a href="mailto:mikclrk#ibm,net">mikclrk#ibm,net</a>, Tue 18 May 1999, 07:01 GMT
</LI>
<LI><strong><A NAME="00302" HREF="msg00302.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>, 
Jo Dillon <a href="mailto:emily#thelonious,new.ox.ac.uk">emily#thelonious,new.ox.ac.uk</a>, Tue 18 May 1999, 07:02 GMT
<UL>
<LI><strong><A NAME="00308" HREF="msg00308.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>, 
Travis S. Casey <a href="mailto:efindel#io,com">efindel#io,com</a>, Wed 19 May 1999, 04:47 GMT
</LI>
<LI><strong><A NAME="00315" HREF="msg00315.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Thu 20 May 1999, 05:20 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00337" HREF="msg00337.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:03 GMT
<UL>
<LI><strong><A NAME="00352" HREF="msg00352.html">Re: [MUD-Dev] Multi-threaded mud server.</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sun 30 May 1999, 04:45 GMT
<UL>
<LI><strong><A NAME="00373" HREF="msg00373.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>, Tue 01 Jun 1999, 21:03 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</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>