Setting operating system thread processor affinity from framework.

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.
 
J

Jerry Pisk

Since you're going to call Win32 API anyways why don't you use
GetCurrentThread or GetCurrentThreadId Win32 API functions?

Jerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top