On Linux, to get a thread count for particular process, issue:
ps UH p PID_OF_PROCESS | wc -l
Removing the pipe to the “| wc -l” yields more information about the running threads.
On Linux, to get a thread count for particular process, issue:
ps UH p PID_OF_PROCESS | wc -l
Removing the pipe to the “| wc -l” yields more information about the running threads.
I don’t know what PS you’ve got, but on mine (RHEL5, , “-U” is for specifying a user, and “-H” does a forest of processes, but not threads.
“awk ‘{ print $20 }’ /proc//stat” should do the job.