I am looking for a way to set the processor affinity of a thread created in managed code by the System.Thread class. I see that ProcessThread has a ProcessorAffinity
property that I understand can be used to set a thread's affinity, however, I do not see a straightforward way to set the affinity of a System.Thread
. The property ManagedThreadId
cannot be used to identify a process thread found in the Process.Threads, it seems that the ProcessThread.Id
is the id of an unmanaged thread (are they the same???).
Any suggestions would be greatly appreciated! I would have thought that this would have been easy.