Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
1697 Discussions

Restricting OS service and appilcation to use specific set of cores

kiranprabhu
Beginner
828 Views

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
828 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.

0 Kudos
iekpo
Beginner
828 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.
0 Kudos
Reply