msg00205.html

1999Q2/msg00205.html · 8.9 KB

From the archive 1999Q2.zip

Download the archive   « Back to the archive contents

<!-- MHonArc v2.4.4 -->
<!--X-Subject: RE: [MUD&#45;Dev] Sockets -->
<!--X-From-R13: "Xba O. Znzoreg" <wyflfvapNvk.argpbz.pbz> -->
<!--X-Date: Tue, 11 May 1999 13:12:02 &#45;0700 -->
<!--X-Message-Id: 199905120250.VAA17382@dfw&#45;ix16.ix.netcom.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199905070401.WAA01676@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, RE: [MUD-Dev] Sockets</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:jlsysinc#ix,netcom.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="msg00203.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00201.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00180.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00215.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00205">Author</A>
&nbsp;|&nbsp;<A HREF="#00205">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00205">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>RE: [MUD-Dev] Sockets</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] Sockets</LI>
<LI><em>From</em>: "Jon A. Lambert" &lt;<A HREF="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</A>&gt;</LI>
<LI><em>Date</em>: Tue, 11 May 1999 22:49:38 -5</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 6 May 99,, Chris Gray wrote:
&gt; [Jon A. Lambert:]
&gt; 
&gt;  &gt;I think the performance boost 
&gt;  &gt;from threading has been understated or misunderstood on single-processor 
&gt;  &gt;machines probably due to early thread implementations.
&gt; 
&gt; Is this deliberate flamebait, or just accidental?

&lt;giggle&gt; Flamebait? Moi? 

&gt; Please explain to me how adding the overhead of thread switches, locks
&gt; and extra memory usage can increase performance. Or, perhaps you meant
&gt; to say "multi-processor machines"? 

Ok. I really meant a single-processor machine, like say one Pentium, as
opposed to dual or quad Pentiums.  

The common select/poll loop for non-blocking sockets that processes 
incoming, exceptions, reads, writes, and other mud processes is not
very efficient.  Firstly setting up the parameters to select and checking 
the FD_SETs involved alone is probably higher overhead than threading.
Secondly if the poll time is too short you end up burning processor 
cycles in the poll loop for no good reason.  And if the time is to long
you end up sleeping while your mud could be processing ripe events that
are issued from other functions in the mud (assuming that not all your 
events are initiated immediately for user input).   Yes, some good 
implementations attempt to dynamically adjust the polling time depending 
on how active the server is/was.  Still there is enough overhead here
to more than compensate for the overhead incurred through thread locks.
   
&gt; One could perhaps imagine how a good
&gt; threaded implementation of something could perform better a poor
&gt; non-threaded implementation, but I don't think that's what you mean.
  
Yes, though I'm imagining a good threaded implementation could well 
outperform a good non-threaded implementation.  :)

A threaded implementation will wake up "exactly" when data is ready on 
the I/O ports and "exactly" when data is ready for sending.  There will
be nothing waiting on I/O period.  I/O of all types whether sockets, 
disk, or console output is much too slow and is the ideal use for 
threading on single-processor machines.    

Thread switching is less intensive than process switching.  Besides, if 
multi-processing OSs weren't efficient we'd all be running DOS instead of 
Linux.   

--
--*     Jon A. Lambert - TychoMUD Email:jlsysinc#ix,netcom.com             *--
--*     Mud Server Developer's Page &lt;<A  HREF="http://pw1.netcom.com/~jlsysinc">http://pw1.netcom.com/~jlsysinc</A>&gt;      *--
--* To fight the empire is to be infected by its derangement. Whosoever    *--
--* defeats part of the empire becomes the empire; it proliferates like a  *--
--* a virus... thereby it becomes its enemies." -- P.K. Dick               *--


_______________________________________________
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="00219" HREF="msg00219.html">Re: [MUD-Dev] Sockets</A></strong>
<ul compact><li><em>From:</em> Mark Gritter &lt;mark#erdos,Stanford.EDU&gt;</li></ul>
<li><strong><A NAME="00210" HREF="msg00210.html">RE: [MUD-Dev] Sockets</A></strong>
<ul compact><li><em>From:</em> Caliban Tiresias Darklock &lt;caliban#darklock,com&gt;</li></ul>
<li><strong><A NAME="00215" HREF="msg00215.html">Re: [MUD-Dev] Sockets</A></strong>
<ul compact><li><em>From:</em> Ola Fosheim Grøstad &lt;olag#ifi,uio.no&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00171" HREF="msg00171.html">RE: [MUD-Dev] Sockets</A></STRONG>
<UL><LI><EM>From:</EM> Chris Gray &lt;cg#ami-cg,GraySage.Edmonton.AB.CA&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00203.html">Re: [MUD-Dev] Autogenerating maps from muds using cardinal directions for exits?</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00201.html">Re: [MUD-Dev] Blending graphics with text</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00180.html">RE: [MUD-Dev] Sockets</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00215.html">Re: [MUD-Dev] Sockets</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00205"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00205"><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] Sockets</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<LI><strong><A NAME="00131" HREF="msg00131.html">Re: [MUD-Dev] Sockets</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Tue 04 May 1999, 05:47 GMT
</LI>
</ul>
<LI><strong><A NAME="00164" HREF="msg00164.html">RE: [MUD-Dev] Sockets</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Thu 06 May 1999, 15:24 GMT
</LI>
<LI><strong><A NAME="00171" HREF="msg00171.html">RE: [MUD-Dev] Sockets</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 08 May 1999, 05:04 GMT
<UL>
<LI><strong><A NAME="00180" HREF="msg00180.html">RE: [MUD-Dev] Sockets</A></strong>, 
Petri Virkkula <a href="mailto:pvirkkul#iki,fi">pvirkkul#iki,fi</a>, Sat 08 May 1999, 18:37 GMT
</LI>
<LI><strong><A NAME="00205" HREF="msg00205.html">RE: [MUD-Dev] Sockets</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Tue 11 May 1999, 20:12 GMT
<UL>
<LI><strong><A NAME="00215" HREF="msg00215.html">Re: [MUD-Dev] Sockets</A></strong>, 
Ola Fosheim Grøstad <a href="mailto:olag#ifi,uio.no">olag#ifi,uio.no</a>, Wed 12 May 1999, 22:15 GMT
<UL>
<LI><strong><A NAME="00244" HREF="msg00244.html">Re: [MUD-Dev] Sockets</A></strong>, 
Ross Nicoll <a href="mailto:rnicoll#lostics,demon.co.uk">rnicoll#lostics,demon.co.uk</a>, Fri 14 May 1999, 08:17 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00210" HREF="msg00210.html">RE: [MUD-Dev] Sockets</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Wed 12 May 1999, 22:17 GMT
</LI>
<LI><strong><A NAME="00219" HREF="msg00219.html">Re: [MUD-Dev] Sockets</A></strong>, 
Mark Gritter <a href="mailto:mark#erdos,Stanford.EDU">mark#erdos,Stanford.EDU</a>, Wed 12 May 1999, 22:26 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</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>

Site Stats

Snippets: 1791
Codebases: 571