Use of SetProcessAffinityMask
-
Hi All ! I'm running an application that spwans several processes and threads, it runs on Windows 2003 Server OS and using 8 cpu's machine(Xeon). We are considering the use of SetProcessAffinityMask to allocate heavy processing jobs to a spcific cpu. My question therfore is this: Using SetProcessAffinityMask, is it possible to tell the OS that I want my process to be the only one using that cpu (i.e. no other process, mine or the OS's, is allowed to run on it) ? is it possible ? :~ We wish to get deteministic results when system is working for long periods of time. thanks, Amit :)
-
Hi All ! I'm running an application that spwans several processes and threads, it runs on Windows 2003 Server OS and using 8 cpu's machine(Xeon). We are considering the use of SetProcessAffinityMask to allocate heavy processing jobs to a spcific cpu. My question therfore is this: Using SetProcessAffinityMask, is it possible to tell the OS that I want my process to be the only one using that cpu (i.e. no other process, mine or the OS's, is allowed to run on it) ? is it possible ? :~ We wish to get deteministic results when system is working for long periods of time. thanks, Amit :)
AmitCohen222 wrote:
no other process, mine or the OS's, is allowed to run on it) ? is it possible ?
I don't believe so. You may want to use SetThreadAffinityMask to distribute threads among processors, but there's no guarantee the system will actually use your suggestions. Try it and test it thoroughly to see if you're actually getting any benefit - from my experience, on XP and above, the OS thread scheduler does a pretty good job without intervention. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java: