Re: which processor is a thread executing on?
Re: which processor is a thread executing on?
- Subject: Re: which processor is a thread executing on?
- From: "Ben Gertzfield" <email@hidden>
- Date: Thu, 2 Oct 2008 15:58:54 -0700
On Thu, Oct 2, 2008 at 10:45 AM, Terry Lambert <email@hidden> wrote:
> There are so many good technical reasons as to why it would be a BAD design
> choice, it's hard to know where to start, so I won't.
One place that per-thread CPU pinning (or thread group scheduling)
really is necessary is for scheduling of a multiprocessor virtual
machine.
In this case, if I have N threads (each of which is a virtual CPU of a
virtual machine) I want to make sure they're either all scheduled
concurrently on separate physical CPUs, or that none are scheduled.
If only one of my N threads is scheduled when the virtual machine is
busy, it's quite likely that one of the other (N - 1) virtual CPUs
holds a resource or lock that the currently-scheduled thread needs.
That means the currently-scheduled thread will spend a majority of its
time looping in a spinlock, waiting for the one of the other threads
to be scheduled. That just chews up CPU, when I'd rather give that
CPU time to other processes' threads, until all of my virtual CPU
threads can be concurrently scheduled.
I can't currently do this with Mac OS X's scheduler, as far as I know.
I just have to hope that all my virtual CPU threads happen to be
scheduled concurrently.
Ben
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden