LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   taskset and affinity masks (https://www.linuxquestions.org/questions/linux-software-2/taskset-and-affinity-masks-782620/)

tethysgods 01-16-2010 12:12 PM

taskset and affinity masks
 
Hi, I am a bit puzzled by how taskset is behaving.

I have just for precessors #0 to #3, or cpus 1 to 4.

I expect the affinity mask 0x00000001 to mean 0001 =cpu1
I expect the affinity mask 0x00000002 to mean 0001 =cpu2
I expect the affinity mask 0x00000003 to mean 0011 =cpu 1+2
I expect the affinity mask 0x00000004 to mean 0100 =cpu 3

up to

I expect the affinity mask 0x0000000f to mean 1111 =cpu 1+2+3+4

But if I do


taskset -c 0x00000004 Flight

my Flight program doggedly appears on cpu 1 on the system monitor.

IK, I only put the mask in because I get an error message (no such cpu) if I put taskset -c 4 Flight

To get it on cpu3 I get the pid of flight and do taskset -p 0x00000004 pid.


What have I been mis-reading over and over?

tethysgods 01-16-2010 12:29 PM

Oh hell,

it was taskset -c n Flight where n=0,1,2,3 not 1,2,3,4, sorry!


All times are GMT -5. The time now is 10:11 AM.