<!-- MHonArc v2.4.4 --> <!--X-Subject: Re: [MUD-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 -0800 --> <!--X-Message-Id: 00b801bf4d84$70dd8210$18095381@POINTSMAN --> <!--X-Content-Type: text/plain --> <!--X-Reference: Pine.LNX.3.96.991223013639.1754G-100000#maul,sith.vpn --> <!--X-Reference: E121C5e-0001kn-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> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg00775.html">Previous</a> | <a href="msg00777.html">Next</a> ] Thread: [ <a href="msg00771.html">Previous</a> | <a href="msg00781.html">Next</a> ] Index: [ <A HREF="author.html#00776">Author</A> | <A HREF="#00776">Date</A> | <A HREF="thread.html#00776">Thread</A> ] <!--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>: <<A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A>></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" <<A HREF="mailto:nop#mitre,org">nop#mitre,org</A>></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" <claw#kanga,nu> writes: > On Thu, 23 Dec 1999 01:40:44 -0800 (PST) > Wesley W Terpstra <terpstra#iota,dhs.org> wrote: > > > You're saying if I spawn two threads and having both work nonstop > > the OS won't put them on different CPUs? > > Not necessarily. Further, very few OSes support runtime thread > migration (IRIX is one of the few FWIW). [..] > If you have say a 2-way box with a single process hogging one CPU, > and the second CPU mostly free, new threads are most likely to be > assigned to the second CPU. This is reasonable. Now let's say that > the hoggy process dies, leaving the second CPU hogged with threads > and the first entirely idle. > > Under most current OSes nothing changes. All the threads continue > execution on the CPU they were originally assigned and the first CPU > remains idle. Future thread and process starts will likely be > assigned to the firt CPU, but if there are none it will remain idle. > Some OSes, and they are very few, will dynamically migrate threads > between CPUs (and even between nodes in a cluster in some cases (cf > 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" <terpstra#iota,dhs.org></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 <claw#kanga,nu></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> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>