user4260053
user4260053

Reputation:

how to find number of threads in any user process ? any variable in task_struct?

is there any member which count total running thread in process in task_struct in linux?

I have read that in linux there is no thread but if we check task directory inside any process directory (proc/[PID]/task), there is directory for all threads of process

Upvotes: 0

Views: 326

Answers (1)

Claudio Corsi
Claudio Corsi

Reputation: 359

The /proc/[pid]/stat file contains information that is used by ps and this information includes the number of threads for the given process pid. Take a look at the man pages for proc(5) for more details.

Upvotes: 0

Related Questions