Linux processor compatibility

Thanks for all the answers!

I have handlers with two cores, and I would like all processes to run on core1, but one. Now I know that I can use a set of tasks to set all current ones to be tied to processor 1, for example. Now, I would like my OWN application to be scheduled to run on processor 2 immediately after the application starts. In other words, is there a way to tell the OS in my application that I would like this particular program to run on processor number 2?

Thank you so much Mareika

+3
source share
4 answers

You can use:

taskset -c 1 -p 123

123 2.

+2

:

http://www.linuxjournal.com/article/6799

.

, , "init" ( ), :

// (Declaration got via 'man sched_setaffinity')
int sched_setaffinity(pid_t pid, size_t cpusetsize,
                         cpu_set_t *mask);

.

+2

init 1. * , , 1, cpu cpu 2.

* , , .

+1

Source: https://habr.com/ru/post/1730264/


All Articles