0

I have a task not parallelizable that I want to process as fast as possible. This task performs pure computation, no I/O.

Of course this task runs on a multi-core system and many other processes are simultaneously doing "things" that also also require CPU usage.

Today, my task is optimized as far as possible (let's say it's perfect :-P), my idea to boost it once again would be to allocate a full CPU for its thread.

In these conditions, no other threads would share the CPU with it, and so, no context switch would interrupt my task; doing that should to speed it a little bit once again with almost no effort. (of course, this would be done to the detriment of other processes but this is not a problem at all: the highest priority is given to my task!)

But how can I do what I want? I know how to set the affinity of the thread of my task in order to assign it to a given CPU but this CPU will potentially be shared with other threads; my problem is not solved

Thank you for your help

Philippe MESMEUR
  • 737
  • 8
  • 22
  • Possible duplicate of [how to shield a cpu from the linux scheduler (prevent it scheduling threads onto that cpu)?](http://stackoverflow.com/questions/11111852/how-to-shield-a-cpu-from-the-linux-scheduler-prevent-it-scheduling-threads-onto) – Philippe MESMEUR Nov 01 '16 at 08:32

1 Answers1

0

While investigating this question, I finally found the following interesting links:

Community
  • 1
  • 1
Philippe MESMEUR
  • 737
  • 8
  • 22