Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-16-2010, 12:12 PM   #1
Registered: May 2004
Posts: 166

Rep: Reputation: 17
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?

Last edited by tethysgods; 01-16-2010 at 12:16 PM.
Old 01-16-2010, 12:29 PM   #2
Registered: May 2004
Posts: 166

Original Poster
Rep: Reputation: 17
Oh hell,

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Taskset on multicore cpu DinoFly Linux - General 4 10-31-2009 05:03 PM
Processor Affinity vikesh.u Linux - Kernel 1 09-07-2009 12:52 PM
Using taskset to set process affinity on multi-core/hyperthreading lennyk Linux - Software 0 04-06-2009 09:29 AM
using lstat st_mode flags and masks smoking81 Programming 1 10-03-2008 05:17 AM
Gentoo Emerge and Masks? carl0ski Linux - Distributions 10 07-18-2006 01:12 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:22 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration