1998Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Thread implementations... -->
<!--X-From-R13: X Q Znjerapr <pynjNhaqre.rate.ftv.pbz> -->
<!--X-Date: Thu, 25 Jun 1998 23:15:34 &#45;0700 -->
<!--X-Message-Id: 199806251903.MAA02880#under,engr.sgi.com -->
<!--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] Thread implementations...</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:claw#under,engr.sgi.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="msg01208.html">Previous</a>
&nbsp;|&nbsp;<a href="msg01210.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg01215.html">Previous</a>
&nbsp;|&nbsp;<a href="msg01208.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#01209">Author</A>
&nbsp;|&nbsp;<A HREF="#01209">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#01209">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Thread implementations...</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] Thread implementations...</LI>
<LI><em>From</em>: J C Lawrence &lt;<A HREF="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</A>&gt;</LI>
<LI><em>Date</em>: Thu, 25 Jun 1998 12:03:05 -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>

Read between the lines and think about this one a bit.  Many MUD
servers essentially implement threads internally with their own light
weight looping structures (COLDX's models hase been discussed here in
this regard, see the archvies).  The following gives a more systemic view

--&lt;cut&gt;--
Date:   Thu, 18 Jun 1998 19:41:03 -0700
From:   "David S. Miller" &lt;davem#dm,cobaltmicro.com&gt;
To:     dgaudet-list-linux-kernel#arctic,org
Subject: Thread implementations...

   Date:        Thu, 18 Jun 1998 11:37:28 -0700 (PDT)
   From: Dean Gaudet &lt;dgaudet-list-linux-kernel#arctic,org&gt;

[ My commented is not directed to Dean or anyone in particular,
  there were just some things I wanted to state in general wrt.
  to the issues raised here. ]

   Even with the debugging problems solved, linuxthreads are heavier
   than solaris pthreads or NT fibers.  Both of those use a
   multiplexed user-level and kernel-level threading system which
   results in fewer kernel context switches.  In userland a "context
   switch" is just a function call.  But we'll see this solved with
   Netscape's NSPR which was released with mozilla -- it provides a
   multiplexed threading model (that particular model isn't ported to
   linux yet).

Making threads under Linux not be multiplexed at the user side was a
conscious design decision.  Doing it half in user half in kernel (and
this is the distinction being mentioned when Solaris nomenclature
speaks of kernel bound and non-kernel bound threads) leads to enormous
levels of complexity for fundamental things such a signal handling.

The folks at Solaris spent a lot of time fixing bugs that were solely
getting signals right in their threads implementation.  Keeping track
of what the kernel sends to a "kernel bound thread" and making sure
the right "pure user thread" within gets that signal correctly is
tricky buisness.  It's complex and hell to get right.  (search the
Solaris patch databases for "threads" and "signals" to see that I'm
for real here about how difficult it is to get right)

This is why we do it the way we do it.

   For example, on NT there is absolutely no problem with opening up
   10000 files at the same time and holding onto the file handles.
   This is exactly what's required to build a top end webserver to get
   winning Specweb96 numbers on NT using TransmitFile.

Yes, I know this.

   On unix there's no TransmitFile, and instead we end up using mmap()
   which has performance problems.  Even if we had TransmitFile, 10k
   file descriptors isn't there.

One thing to keep in mind when people start howling "xxx OS allows
such and such feature and Linux still does not yet, why is it so
limited etc.???"  Go do a little research, and find out what the cost
of 10k file descriptors capability under NT is for processes which
don't use nearly that many.

I know, without actually being able to look at how NT does it, it's
hard to say for sure.  But I bet low end processes pay a bit of a
price so these high end programs can have the facility.

This is the reason Linux is still upcoming with the feature.  We won't
put it in until we come up with an implementation which costs next to
nothing for "normal" programs.

   "You have to recompile your kernel for that."  Uh, no thanks, I
   have a hard enough time getting webserver reviewers to use the
   right configuration file, asking them to recompile a kernel is
   absolutely out of the question.

I actually don't tell people to do this.  Instead I tell them to find
a solution within the current framework, and that what they are after
is in fact in the works.  If someone can't make it work in the current
framework, Linux is not for them at least for now.  A bigger danger
than losing users or apps for the moment due to missing features, is
to mis-design something and end up paying for it forever, this is the
path other unixs have gone down.

   Unix multiplexing facilities -- select and poll -- are wake-all
   primitives.  When something happens, everything waiting is awakened
   and immediately starts fighting for something to do.  What a waste.
   They make a lot of sense for processes though.  On NT completion
   ports provide wake-one semantics... which are perfect for threads.

Yes, this does in fact suck.  However, the path to go down is not to
expect the way select/poll work to change, rather look at other
existing facilities or invent new ones which solve this problem.
Too much user code exists which depends upon the wake-all semantics,
so the only person to blame is whoever designed the behaviors of these
unix operations to begin with ;-)

Later,
David S. Miller
davem#dm,cobaltmicro.com

--&lt;cut&gt;--

I knew the guys at CobaltMicro weren't stupid.

-- 
J C Lawrence                               Internet: claw#null,net
(Contractor)                               Internet: coder#ibm,net
---------(*)                     Internet: claw#under,engr.sgi.com
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...


</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="msg01208.html">[MUD-Dev] I/O Event Handling Under Linux by Richard Gooch</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg01210.html">[MUD-Dev] Re: stuff that makes me leave (was Re: In game bulletin...)</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg01215.html">[MUD-Dev] Re: Suggested theme</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg01208.html">[MUD-Dev] I/O Event Handling Under Linux by Richard Gooch</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#01209"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#01209"><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><A NAME="01235" HREF="msg01235.html">[MUD-Dev] Re: Quotes from Marcus Ranum</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 27 Jun 1998, 19:46 GMT
<LI><strong><A NAME="01226" HREF="msg01226.html">[MUD-Dev] Quotes from Marcus Ranum</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Fri 26 Jun 1998, 22:05 GMT
<UL>
<LI><strong><A NAME="01231" HREF="msg01231.html">[MUD-Dev] Re: Quotes from Marcus Ranum</A></strong>, 
Nathan F Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Sat 27 Jun 1998, 02:57 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="01215" HREF="msg01215.html">[MUD-Dev] Re: Suggested theme</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Fri 26 Jun 1998, 14:45 GMT
<LI><strong><A NAME="01209" HREF="msg01209.html">[MUD-Dev] Thread implementations...</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Fri 26 Jun 1998, 06:15 GMT
<LI><strong><A NAME="01208" HREF="msg01208.html">[MUD-Dev] I/O Event Handling Under Linux by Richard Gooch</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Fri 26 Jun 1998, 06:05 GMT
<UL>
<LI><strong><A NAME="01216" HREF="msg01216.html">[MUD-Dev] Re: I/O Event Handling Under Linux by Richard Gooch</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Fri 26 Jun 1998, 16:45 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="01206" HREF="msg01206.html">[MUD-Dev] (fwd) Dantom's Universal Network Game (DUNG)</A></strong>, 
Nathan Fenenga Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Fri 26 Jun 1998, 05:48 GMT
<LI><strong><A NAME="01201" HREF="msg01201.html">[MUD-Dev] ScryMUD:  Source release, version 1.4</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Thu 25 Jun 1998, 06:10 GMT
</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>