title: How can I set processor affinity to a thread or a Task in .NET?
body: <p>Can we set two threads or two tasks to execute with different processor affinity in a C# application?</p>
  <p>I have read about <code>SetThreadAffinityMask</code>, but have found no example of how that should be used.</p>
  <p>Alternatively, is there any way for TPL (Task Parallel Library) to execute two threads/Tasks with high priority to use 100% CPU?</p>