Results 1 to 5 of 5
How to list all the threads spawned by a process?...
- 12-29-2010 #1Just Joined!
- Join Date
- May 2010
- Posts
- 19
listing all threads in a process
How to list all the threads spawned by a process?
- 12-30-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
The ps command can do this. Try ps -eLF the output of which you can filter with grep for the process(es) you are interested in.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 12-30-2010 #3Just Joined!
- Join Date
- May 2010
- Posts
- 19
@Rubberman
Ps -eLF does not display the "Thread name", There are multiple threads created by a process.
How to distinguish between them??
- 12-30-2010 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Threads have no names other than the process that spawned them. You can use the tid (thread id), but you really should read the threads manpage - there is a lot you need to understand about posix threads and how they are implemented in Linux before you go any further.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 12-30-2010 #5
I'm not entirely sure what you mean by "list all threads".
If you want to know how many threads a given process has, you can check the /proc/PID/task directory. This directory contains a directory for every thread in the process. These directories are named by the thread ID.
What information are you looking for exactly?DISTRO=Arch
Registered Linux User #388732


Reply With Quote