Operating System - HP-UX
1748166 Members
3648 Online
108758 Solutions
New Discussion юеВ

getting number of threads

 
Ullrich Rieger
Occasional Contributor

getting number of threads

Hi,
Is there any tool (beside glance or measureware) that tells me, how many threads are activbe in each process?
6 REPLIES 6
Rita C Workman
Honored Contributor

Re: getting number of threads

Depends on the o/s your on...

Prior to 10.3 you could only get this via Glance or MWA.

In 11.0 you can get this information from kernel parms
nkthread , max_thread_proc

/rcw
Ullrich Rieger
Occasional Contributor

Re: getting number of threads

I'm using 11.0.

The kernel parameters only tell me the maximum number of threads for each process (max_thread_proc) or for the whole system (nkthread). What I want to know is the number of threads actually running on the machine or within a single process.
Kiran N. Mehta
Advisor

Re: getting number of threads

Hi:
you could attach a debugger and list the live threads (dde prompt> list threads)

Kiran
Andy Monks
Honored Contributor

Re: getting number of threads

You can use the pstat system call to get this info.

small demo program attached.
Ullrich Rieger
Occasional Contributor

Re: getting number of threads

Hello Andy Monks
The pstat hint is interesting, but I'm afraid, you forgot to attach the example.
Andy Monks
Honored Contributor

Re: getting number of threads

Hmm, sure I did. Lets try it again.