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