11

I have the pid of the process. I would like to know the current number of thread running in the process. I know I can read /proc/pid/stat for this information, but I'm not sure how to specifically get the number of threads from stat. Can anyone help?

Thanks!

Irlanco
  • 213

1 Answers1

15

The number of entries in /proc/pid/task is the number of threads in the process. Also, /proc/pid/status has a Threads line. In /proc/pid/stat, it's the 20th field.