How can I set the processor affinity of a process on Linux?
Computer CPUs have many cores insde them nowadays.
I have always wondered if there is a way to, when I start a process on the Linux command line, specify which particular core or cores that process might use?
For example, can I start a massive grep task and say "use ALL of CPU2 for yourself".
Or could I start a find task and say "never leave CPU3".
Or maybe I could start a video decoding task and say "use whatever is available on CPU1 and CPU2"
OR, is there no way to do this because it is not needed and the OS is doing this kind of stuff intelligently by itself (based on nice levels and general resource usage of the process etc)