lkml.org 
[lkml]   [2005]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: how to find all threads of a given process?
From

jesse said:
> suppose I already know the PID of a process, how could
> i quickly identify all threads of this process?
>
> As i know, under /proc, threads of all processes have
> prefix ".", one way is to iterate each one and do the
> check. the approach is too expensive. any other
> suggestions?
>
> for instance,

wouldn't this be easier in user space using "ps H" then one of two options
happens depending on the use of fork and other issues (making the question
hard to answer as stated) either A: they will all have the same PID or
B:they will all have varying PIDs in the later case you could use looks
for all PIDs sharing the same ancestor PPID (depending on how far down you
are in the fork list)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.044 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site