Community
cancel
Showing results for 
Search instead for 
Did you mean: 
kiranprabhu
Beginner
30 Views

Restricting OS service and appilcation to use specific set of cores

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.

Thanks

Kiran

0 Kudos
2 Replies
Dmitry_Vyukov
Valued Contributor I
30 Views

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.

iekpo
Beginner
30 Views

I believe OpenMP and Intel TBB have tools that would allow you to set the affinity for a particular thread to a specific core. You should look into it.