Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Dec 1999 18:35:22 -0700
From:      Nate Williams <nate@mt.sri.com>
To:        Chuck Robey <chuckr@picnic.mat.net>
Cc:        Arun Sharma <adsharma@sharmas.dhs.org>, freebsd-arch@freebsd.org
Subject:   Re: Thread scheduling
Message-ID:  <199912110135.SAA23495@mt.sri.com>
In-Reply-To: <Pine.BSF.4.10.9912102019490.16082-100000@picnic.mat.net>
References:  <19991210114304.A3372@sharmas.dhs.org> <Pine.BSF.4.10.9912102019490.16082-100000@picnic.mat.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> > > 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912110135.SAA23495>