sharptooth
sharptooth

Reputation: 170509

How do I replace SetProcessAffinityMask()/GetProcessAffinityMask() for systems with more than 32 cores?

SetProcessAffinityMask() function accepts a DWORD mask so it can't be used correctly on systems with more than 32 processors.

Looks like SetThreadGroupAffinity() is intended to somehow address the problem, but I can' find any useful code samples that illustrate its usage?

How do I adapt my program using SetProcessAffinityMask()/GetProcessAffinityMask() for systems with more than 32 processors? Are there any code samples?

Upvotes: 2

Views: 1868

Answers (1)

David Heffernan
David Heffernan

Reputation: 613262

First of all SetProcessAffinityMask() accepts DWORD_PTR. Since 32 bit versions of the OS do not support >32 cores, this means that you are talking about 64 bit OS. And so the actual limit for SetProcessAffinityMask() is therefore 64.

As for how to handle >64 I think the Supporting Systems That Have More Than 64 Processors whitepaper will tell you what you need to know.


EDIT

You state in the comments that your code is 32 bit running on 64 bit OS.

As I understand it, there is limited support for very fine-grained control if you are running inside the 32 bit emulator on a 64 bit OS. The assumption is that if you want to take advantage of these new capabilities you are expected to stop using the emulator.

Upvotes: 2

Related Questions