Hi is there any way to restrict OS(Windows 2008 Server) services and startup applications to runon a set ofCores/Processor so that other cores are free to execute an application written by me( i am using C++/.Net). I wish to dedicate certain cores for my application.
The easiest way to achieve this is as follows.
Bind your application's threads to a subset of processors with SetProcessAffinityMask(GetCurrentProcess(), mask).
Raise priority of your process as much as possible with SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);
Raise priority of all your threads as much as possible with SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
I believe this way you will occupy the processors almost entirely. OS can schedule some episodic activities on the processors anyway, but I think that's inevitable.