Is processor ID static
I am using sched_set_affinity() in a C program to assign each thread to a specific processor. Is it safe to assume that the processor ID used in cpu_mask stay the same, even after system reboots ?
Thank you very much in advanced for any input.
processor ID should always be static.
As the processor ID should have a direct hardware mapping to the cores of the CPU.
Although I do not recommend you to assign specific processors for tiny programs that have tiny computations.
Depending on what you want to run ;
the code will need to be alot more complicated as you will need to write redundancy code in case specified processor can not compute the task in order to reassign task to diffrent processors.
Systems and Telecom Engineer