What command can I use to check if a specific process is being spreaded among multiple cpus?
----- "Erick Perez" eaperezh@gmail.com wrote:
What command can I use to check if a specific process is being spreaded among multiple cpus?
You can use "top" (among others) to see "where" your process are running, run top, and type "f" and then "J", it'll add a "P"rocessor column on top.
But, _a_ process can't spread on multiple CPUs... to do this the application need to be specificaly designed to do so. A way to do this is using multi-threads, another one is forking multi-instances. But, with only one instance running an application will use only one CPU.
Antonio.
On Wed, Apr 04, 2007 at 08:06:13AM -0300, Antonio da Silva Martins Junior wrote:
But, _a_ process can't spread on multiple CPUs... to do this the application need to be specificaly designed to do so. A way to do this is using multi-threads, another one is forking multi-instances. But, with only one instance running an application will use only one CPU.
A multi-threaded application is one process. I'm not sure how to display them separately in top -- in 'ps', you use the 'm' flag, like `ps auxm`, or else -L, like `ps -eLf`.
I'm not sure how to show which CPU is being used by a given thread at any given moment. However, I don't think that's really necessary to answer to original question, because we can usually trust Linux to do the right thing here. If your program is multithreaded, it will be spread among multiple CPUs as appropriate. So, just use the above command and count the threads.