LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-22-2011, 03:54 PM   #1
jeffwang66
LQ Newbie
 
Registered: Jan 2011
Posts: 27

Rep: Reputation: 0
How to determine the cpu number on which the process is running


Hi, guys:

When I fork multiple processes, is there some command or c function to see the cpu number on which the processes are running?


Thanks
 
Old 02-22-2011, 04:46 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
You can see it in top -

Code:
top
f
j
.. the 'P' column will now be visible which is the processor that the task was last run on.

Please note that the task scheduler in the 2.6 series kernel will *automatically* redistribute processes in a SMP system if the cpu's are not equally loaded

cheers
 
Old 02-22-2011, 05:16 PM   #3
jeffwang66
LQ Newbie
 
Registered: Jan 2011
Posts: 27

Original Poster
Rep: Reputation: 0
Thanks. Which argument of "top" command I need to use? Because I did not see the 'P' column.




Quote:
Originally Posted by kbp View Post
You can see it in top -

Code:
top
f
j
.. the 'P' column will now be visible which is the processor that the task was last run on.

Please note that the task scheduler in the 2.6 series kernel will *automatically* redistribute processes in a SMP system if the cpu's are not equally loaded

cheers
 
Old 02-22-2011, 05:56 PM   #4
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
Read the answer again - carefully.
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine number of blocks for a partition rcmonroig Linux - Newbie 1 07-01-2010 06:27 AM
Get process running CPU core and the utilisation on that core... chamila1986 Programming 5 04-28-2010 06:00 PM
How to know cpu running process ravibhure Linux - Newbie 7 07-22-2009 10:04 AM
how to tell which CPU process is running on? abolishtheun Linux - Software 2 04-09-2009 08:01 AM
How to determine whether a PROCESS is running, by a SHELL program? yuzuohong Linux - General 4 01-21-2003 09:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:44 PM.

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