1999Q2/
<!-- 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:10:00 &#45;0700 -->
<!--X-Message-Id: 199905120430.XAA18717@dfw&#45;ix2.ix.netcom.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199905091643.KAA02372@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="msg00191.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00193.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00184.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00223.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00192">Author</A>
&nbsp;|&nbsp;<A HREF="#00192">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00192">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>: Wed, 12 May 1999 00:30:00 -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 9 May 99,, Chris Gray wrote:
&gt; 
&gt; The WIN32 interface in particular is one which essentially forces the
&gt; programmer to use multiple threads. 

There is no NEED to use multiple threads in Win32.  Non-blocking sockets
perform exactly like their BSD counterparts,

&gt; Consider the "asynchronous I/O"
&gt; features available. You can use their completion routines stuff, but they
&gt; aren't really asynchronous because they are only triggered when some
&gt; I/O related system call completes (e.g. a poll). You can use their
&gt; interface which sends a message on call completion, but for that you
&gt; have to have an active window, which is something a MUD server (or http
&gt; server or ftp server, etc.) is not likely to want. 

Yes. This is true.  Asynchronous sockets require you to use the Windows 
messaging system.  Thus they cannot be used from a console application.
And that's why I ranked this method third in performance.  Yet it still
performs much better than non-blocking.  Comparing this particular 
mechanism with anything on *nixes is useless, since it doesn't exist.

&gt; for that, WaitForMultipleObjects, has a fixed, hard limit of 64 handles
&gt; that it can wait on. If you want more than that, you have to either
&gt; start polling (ugh!) or have multiple threads, each waiting for groups
&gt; of handles. 

Polling (ugh!)?  But aren't you doing that in your non-blocking sockets 
apps?  I can't imagine using WaitForMultipleObjects handles in this 
manner.  This is the same (or worse because of the limitation) as single-
threaded non-blocking sockets.  That is, it would be a "poor" 
implementation.  I use WaitForMultipleObjects on two handles.  One is on 
the socket input event and one is on the muds output work queue.  The 
thread is fired when data arrives on the socket OR when data arrives on 
the output queue.   If I ever need to deal with huge amounts of 
connections I can pool multiple sockets and work queues to threads.  I 
don't know what the "huge" number would be yet; 100?, 200?, 500?, 1000?
 
&gt; So, I agree, that if you are programming under the WIN32
&gt; API, you will get better performance by using threads than if you
&gt; didn't, but *that is a result of the nature of the API, rather than any
&gt; inherent advantage of threads*.

I KNOW that threading I/O  performs better on Win32.  
The question is "Does threading I/O perform better on Linux/BSD?"
    
If someone would ACTUALLY DO IT in Linux/BSD, perhaps the question could 
be answered rather than theorized at.


--
--*     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="00224" HREF="msg00224.html">RE: [MUD-Dev] Sockets</A></strong>
<ul compact><li><em>From:</em> Daniel Garcia &lt;dgarcia#hollyfeld,org&gt;</li></ul>
<li><strong><A NAME="00223" HREF="msg00223.html">RE: [MUD-Dev] Sockets</A></strong>
<ul compact><li><em>From:</em> Caliban Tiresias Darklock &lt;caliban#darklock,com&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00184" HREF="msg00184.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="msg00191.html">RE: [MUD-Dev] Custom Server Roll Call?</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00193.html">Re: [MUD-Dev] Custom Server Roll Call?</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00184.html">RE: [MUD-Dev] Sockets</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00223.html">RE: [MUD-Dev] Sockets</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00192"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00192"><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>
<ul compact>
<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
<UL>
<LI><strong><A NAME="00218" HREF="msg00218.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>
</ul>
<LI><strong><A NAME="00184" HREF="msg00184.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>, Sun 09 May 1999, 11:23 GMT
<UL>
<LI><strong><A NAME="00192" HREF="msg00192.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:10 GMT
<UL>
<LI><strong><A NAME="00223" HREF="msg00223.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:27 GMT
<UL>
<LI><strong><A NAME="00247" HREF="msg00247.html">RE: [MUD-Dev] Sockets</A></strong>, 
Nicholas Lee <a href="mailto:N.J.Lee#statslab,cam.ac.uk">N.J.Lee#statslab,cam.ac.uk</a>, Fri 14 May 1999, 08:24 GMT
<UL>
<LI><strong><A NAME="00268" HREF="msg00268.html">RE: [MUD-Dev] Sockets</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Sun 16 May 1999, 07:56 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00296" HREF="msg00296.html">RE: [MUD-Dev] Sockets</A></strong>, 
Adam Wiggins <a href="mailto:adam#angel,com">adam#angel,com</a>, Tue 18 May 1999, 06:42 GMT
</LI>
</UL>
</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>