Find the answer to your Linux question:
Results 1 to 5 of 5
How to list all the threads spawned by a process?...
  1. #1
    Just Joined!
    Join Date
    May 2010
    Posts
    19

    listing all threads in a process

    How to list all the threads spawned by a process?

  2. #2
    Linux Guru Rubberman's Avatar
    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!

  3. #3
    Just 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??

  4. #4
    Linux Guru Rubberman's Avatar
    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!

  5. #5
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...