Operating System - HP-UX
1827234 Members
2426 Online
109716 Solutions
New Discussion

number of threads for task/processes

 
mario_43
Occasional Contributor

number of threads for task/processes

Hi folk,

I'd like know the number of threads associate with every task/processes the system show me in ouptut at the ps -ef command.
I read the "man ps" but I didn't find the answer.
Who know waht to do?
Thanks in advance.
M.
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: number of threads for task/processes

Hi:

The kernel parameter 'max_thread_proc' controls the number of threads a process can create at a time. 'nkthread' sets the maximum number of threads system-wide.

Regards!

...JRF...
Massimo Bianchi
Honored Contributor

Re: number of threads for task/processes

Hi,
the only tool i know that can do that is glace.

You can have a free 60days trial. Plan to buy it, it worth the cost. You can find it in the application CD

Massimo
James Murtagh
Honored Contributor

Re: number of threads for task/processes

Hi Mario,

for hpux 11.00 and later you can use the attached program. Just compile it with no special options and run. It takes the pid as the argument, i.e.

# ./threads 2081

Process 2081 has 3 threads

regards,

James.
Tim D Fulford
Honored Contributor

Re: number of threads for task/processes

glance give the number of threads attached to a process

Regards

Tim
-
Mike Stroyan
Honored Contributor

Re: number of threads for task/processes

Note that glance and pstat_getproc used by James Murtagh's program both report kernel threads. They won't see libcma style threads used by 10.20 programs (and a few programs linked on 11.x with libcma threads).
Programs linked on 11.22 and later (on Itanium) will default to "MxN" threads which migrate user space threads among a pool of kernel threads. That can make thread counting complicated.