Re: How does one know how many thread a process owns?

From: Dan Nelson <dnelson_at_allantgroup.com>
Date: Wed, 13 Apr 2005 12:40:08 -0500
In the last episode (Apr 13), David Xu said:
> Giorgos Keramidas wrote:
> >On 2005-04-13 17:15, Jiawei Ye <leafy7382_at_gmail.com> wrote:
> >>On 4/13/05, David Xu <davidxu_at_freebsd.org> wrote:
> >>>I believe he wants to see total threads number in a process. add a
> >>>column to top to display total kernel threads in per-process,
> >>>p_numthreads in proc structure is what you need . :)

Still only accurate for libthr, though, right?

> >>Exactly what I want. Is is possible to modify our top?
> >
> >I've added a THR column when top displays only one line per process.
> >So when the "display each thread separately" mode is off, you should
> >see something like this:

I sort of like Solaris' prstat output, where the thread count is after
the command:

   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
  3120 dnelson  9320K 7256K sleep    0   19   0:00:01 0.3% pike/2
  3169 dnelson  4800K 4440K cpu3    59    0   0:00:00 0.2% prstat/1
  3144 dnelson  4192K 2936K sleep   59    0   0:00:00 0.1% zsh/1
 17037 root       89M   26M sleep   29   10   3:02:52 0.1% java/23

I also find myself asking exactly what our CPU column really
represents.  Is it any use at all?

-- 
	Dan Nelson
	dnelson_at_allantgroup.com
Received on Wed Apr 13 2005 - 15:40:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:32 UTC