1999Q4/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...) -->
<!--X-From-R13: "Xnl Qneyfba" <abcNzvger.bet> -->
<!--X-Date: Thu, 23 Dec 1999 12:50:07 &#45;0800 -->
<!--X-Message-Id: 00b801bf4d84$70dd8210$18095381@POINTSMAN -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: Pine.LNX.3.96.991223013639.1754G&#45;100000#maul,sith.vpn -->
<!--X-Reference: E121C5e&#45;0001kn&#45;00#dingo,kanga.nu -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting </title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:nop#mitre,org">
</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="msg00775.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00777.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00771.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00781.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00776">Author</A>
&nbsp;|&nbsp;<A HREF="#00776">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00776">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: &lt;<A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A>&gt;</LI>
<LI><em>Subject</em>: Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...) </LI>
<LI><em>From</em>: "Jay Carlson" &lt;<A HREF="mailto:nop#mitre,org">nop#mitre,org</A>&gt;</LI>
<LI><em>Date</em>: Thu, 23 Dec 1999 15:29:41 -0500</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>
"J C Lawrence" &lt;claw#kanga,nu&gt; writes:


&gt; On Thu, 23 Dec 1999 01:40:44 -0800 (PST)
&gt; Wesley W Terpstra &lt;terpstra#iota,dhs.org&gt; wrote:
&gt;
&gt; &gt; You're saying if I spawn two threads and having both work nonstop
&gt; &gt; the OS won't put them on different CPUs?
&gt;
&gt; Not necessarily.  Further, very few OSes support runtime thread
&gt; migration (IRIX is one of the few FWIW).

[..]

&gt;   If you have say a 2-way box with a single process hogging one CPU,
&gt; and the second CPU mostly free, new threads are most likely to be
&gt; assigned to the second CPU.  This is reasonable.  Now let's say that
&gt; the hoggy process dies, leaving the second CPU hogged with threads
&gt; and the first entirely idle.
&gt;
&gt;   Under most current OSes nothing changes.  All the threads continue
&gt; execution on the CPU they were originally assigned and the first CPU
&gt; remains idle.  Future thread and process starts will likely be
&gt; assigned to the firt CPU, but if there are none it will remain idle.
&gt; Some OSes, and they are very few, will dynamically migrate threads
&gt; between CPUs (and even between nodes in a cluster in some cases (cf
&gt; IRIX CC:NUMA)) at runtime to best use available resources.

I think you need to go reread /usr/src/linux/kernel/sched.c, unless you're
already counting Linux as one of the "very few".  Linux is quite willing to
move processes between CPUs in an SMP box.  There is a minor bias in favor
of keeping a process assigned to the same CPU, but the current feeling is
that stalling a process to hopefully get a warm cache on its previous CPU is
a waste.

Come to think of it, Solaris 7 on sparc hardware is reassigning processors
for the /usr/local/bin/top process I'm running right now, every fifteen
seconds or so.

Migration between nodes in a cluster, yes, very few operating systems do
that.

Jay






_______________________________________________
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="00764" HREF="msg00764.html">[MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></STRONG>
<UL><LI><EM>From:</EM> "Wesley W. Terpstra" &lt;terpstra#iota,dhs.org&gt;</LI></UL></LI>
<LI><STRONG><A NAME="00771" HREF="msg00771.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></STRONG>
<UL><LI><EM>From:</EM> J C Lawrence &lt;claw#kanga,nu&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00775.html">Re: Re[4]: [MUD-Dev] The grass is always greener in the other field</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00777.html">Re: [MUD-Dev] Collecting ideas for a MUD server... (fwd)</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00771.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00781.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00776"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00776"><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] Collecting ideas for a MUD server... (fwd)</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00763" HREF="msg00763.html">Re: [MUD-Dev] Collecting ideas for a MUD server... (fwd)</A></strong>, 
Rahul Sinha <a href="mailto:rsinha#glue,umd.edu">rsinha#glue,umd.edu</a>, Thu 23 Dec 1999, 17:00 GMT
<UL>
<LI><strong><A NAME="00772" HREF="msg00772.html">Re: [MUD-Dev] Collecting ideas for a MUD server... (fwd)</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Thu 23 Dec 1999, 17:48 GMT
</LI>
</UL>
</LI>
</ul>
<LI><strong><A NAME="00764" HREF="msg00764.html">[MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></strong>, 
Wesley W. Terpstra <a href="mailto:terpstra#iota,dhs.org">terpstra#iota,dhs.org</a>, Thu 23 Dec 1999, 17:00 GMT
<UL>
<LI><strong><A NAME="00771" HREF="msg00771.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Thu 23 Dec 1999, 17:31 GMT
<UL>
<LI><strong><A NAME="00776" HREF="msg00776.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></strong>, 
Jay Carlson <a href="mailto:nop#mitre,org">nop#mitre,org</a>, Thu 23 Dec 1999, 20:50 GMT
</LI>
<LI><strong><A NAME="00781" HREF="msg00781.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></strong>, 
Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Fri 24 Dec 1999, 07:47 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00773" HREF="msg00773.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></strong>, 
Marc Bowden <a href="mailto:ryumo#merit,edu">ryumo#merit,edu</a>, Thu 23 Dec 1999, 18:00 GMT
</LI>
</UL>
</LI>
</ul>
</ul>
<LI><strong><A NAME="00749" HREF="msg00749.html">Re: [MUD-Dev] Collecting ideas for a MUD server... (fwd)</A></strong>, 
Rahul Sinha <a href="mailto:rsinha#glue,umd.edu">rsinha#glue,umd.edu</a>, Thu 23 Dec 1999, 05:36 GMT
<UL>
<LI><strong><A NAME="00755" HREF="msg00755.html">Re: [MUD-Dev] Collecting ideas for a MUD server... (fwd)</A></strong>, 
J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Thu 23 Dec 1999, 06:49 GMT
</LI>
</UL>
</LI>
</ul>
</ul>
</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>