Just how can I set the cpu fondness of a process on Linux?
Inside the process, the call would certainly be
sched_setaffinity(), or for pthreads things,
On a relevant note, if you're bothering with CPU fondness of your program, it might be rewarding to take notice of just how it's doing memory appropriation too. Bigger systems with memory affixed to greater than one controller (i.e. numerous CPU outlets, each with their very own) will certainly have variable latency and also transmission capacity in between various CPU - memory sets. You'll intend to check into NUMA fondness too, making use of the
numactl command or the system calls that it collaborates with. One program I worked with obtained a 10% efficiency renovation from this.