From owner-freebsd-arch Fri Dec 10 17:35:43 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id DF58E14DA4 for ; Fri, 10 Dec 1999 17:35:40 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id CAA05053 for ; Sat, 11 Dec 1999 02:35:39 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id CAA39845 for freebsd-arch@freebsd.org; Sat, 11 Dec 1999 02:35:39 +0100 (MET) Received: from ns.mt.sri.com (ns.mt.sri.com [206.127.79.91]) by hub.freebsd.org (Postfix) with ESMTP id 03BCE14D10 for ; Fri, 10 Dec 1999 17:35:27 -0800 (PST) (envelope-from nate@mt.sri.com) Received: from mt.sri.com (rocky.mt.sri.com [206.127.76.100]) by ns.mt.sri.com (8.9.3/8.9.3) with SMTP id SAA29086; Fri, 10 Dec 1999 18:35:23 -0700 (MST) (envelope-from nate@rocky.mt.sri.com) Received: by mt.sri.com (SMI-8.6/SMI-SVR4) id SAA23495; Fri, 10 Dec 1999 18:35:22 -0700 Date: Fri, 10 Dec 1999 18:35:22 -0700 Message-Id: <199912110135.SAA23495@mt.sri.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Chuck Robey Cc: Arun Sharma , freebsd-arch@freebsd.org Subject: Re: Thread scheduling In-Reply-To: References: <19991210114304.A3372@sharmas.dhs.org> X-Mailer: VM 6.34 under 19.16 "Lille" XEmacs Lucid Reply-To: nate@mt.sri.com (Nate Williams) Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > > In scheduling multiple threads on a FreeBSD SMP system, is it just > > > important that if a thread asks for multiple processors, then it can > > > contend for multiple processors, or is it in any way important that these > > > multiple instances of execution from the same memory space actually occur > > > at the same point in time. > > > > A thread can't be scheduled on more than one processor simultaneously. > > Multiple threads in the same process can be. Assuming that this is > > what you meant... > > > > Is it desirable ? Yes. Can it be guaranteed ? Not easily. If you have a > > SMP machine dedicated to a particular task like web serving, the > > optimal use of the system would be to run multiple threads in the same > > address space on multiple processors. > > I note that Nate disagreed with you ... I actually think we're in agreement, but our definitions differ. > dropping the subject of if it can > be done as premature, your blank statement of "Yes" isn't enough; can you > offer some reason why it's desireable? If the task is reasonably active, > it'll stay in memory, so extra time won't be spent swapping. I think that > all caching is done per processor, not per memory space, and (if I'm right > on that) then there wouldn't be a caching reason, right? > > Why is it desireable? It is desirable for effeciency reasons (if two threads are running on seperate CPU's, then twice as much work will get done), as well as the cache issues. But, is making it a requirement desirable? Not in my book. (I may have misunderstood your 'desirable' statement previously by reading that making assuming that you were wondering if is desirable to make it a requirement, which is silly now that I think about it.) However, is it desirable to have multiple threads in a single process executing on multiple CPUs? Of course, if the benefits don't outweight the costs in terms of complexity and such. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message