1

Due to suddenly operating on Windows 2012 servers with more than 64 processors, we are forced to contend with multiple processor groups.

With our setup, it will be difficult to initiate processes and specify the target processor group, so we are aiming to alter the processor group of a number of processes in c# or c++.

Given we can get the list of process handles, what is required to:

  1. Get the processor group that each of those processes are running upon

  2. Update a certain set of those processes' processor group values to change which group they're running upon.

evpo
  • 2,436
  • 16
  • 23

2 Answers2

1

A process is assigned to a group by Windows when it is created. It does not seem that this can be changed directly.

To get the list of processor groups a process belongs to (there can be more than one), call GetProcessGroupAffinity.

To update the group for a process, you'll have to change the group for each of the threads of the process using SetThreadGroupAffinity. This would obviously be easiest when it is just starting and only has one thread.

1201ProgramAlarm
  • 32,384
  • 7
  • 42
  • 56
0

I like to quote this related MSDN forum answer: Process Affinity on a System with 128 Processors

In theory you could create a small driver that uses KeSetSystemGroupAffinityThread to change the affinity. I say in theory because sine this is a new call and limited documentation it may not work. Of course once you do it there is the question if the application will work, I assume you have read http://download.microsoft.com/download/a/d/f/adf1347d-08dc-41a4-9084-623b1194d4b2/MoreThan64proc.docx with its warnings about multiple groups and applications that were not written to take advantage of them.

Also have a look at: Example usage of SetProcessAffinityMask in C++?

wp78de
  • 18,207
  • 7
  • 43
  • 71