Bob said:
Is there a way to specifiy what processor to run a thread on in a quad core
processor in c#. Any links or direction is greatly appreciated.
I don't know if you can do this using only managed code. However, you
should be able to accomplish it by using the
Thread.BeginThreadAffinity() method (to ensure that the managed thread
stays with a specific OS thread) and then using p/invoke to call the
unmanaged function SetThreadAffinityMask() (which is what will actually
assign the thread to a specific CPU core).
If you are okay with your code running only on the Xbox 360, you can use
the Thread.SetProcessorAffinity() method found in XNA.
If you could determine what thread is the current ProcessThread, that
class has a ProcessorAffinity property that you could use. Maybe
there's a way to do that, but if it is, it's either not obvious or I'm
too tired to find it.
Pete