Setting operating system thread processor affinity from framework.

  • Thread starter Thread starter Andrew Stephen
  • Start date Start date
A

Andrew Stephen

Hi - I have read many posts around this topic and my feeling is that
what I am about to ask advice on is bad practice, but I need to
experiment with it so I will ask anyway :

Does anyone know a way to to identify the current operating system
thread from the ProcessThread collection in
System.Diagnostics.Process.GetCurrentProcess().Threads
in order to pass it to the SetThreadAffinityMask WinAPI and set a
processor affinity for the thread?

Thank you in advance .... Andrew.
 
Since you're going to call Win32 API anyways why don't you use
GetCurrentThread or GetCurrentThreadId Win32 API functions?

Jerry
 
Back
Top