Re: command to see if a process is being spread among multiple cpus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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.

-- 
Matthew Miller           mattdm@xxxxxxxxxx          <http://mattdm.org/>
Boston University Linux      ------>              <http://linux.bu.edu/>
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux