[lug] Re: ps on AS 2.1, 3.0

D. Stimits stimits at comcast.net
Fri Apr 22 11:28:50 MDT 2005


Andrew Diederich wrote:
> On 4/21/05, Dean Brissinger <Dean.Brissinger at vexcel.com> wrote:
> 
>>        The 2.4 and earlier kernels don't support Posix threads. Sure, each
>>thread _should_ have the same pid but instead they're actual processes
>>with their own.  You can find lots about this behavior on google groups.
>>
>>        As for 'ps'...  Some distributions saw fit to "fix" ps, top, and
>>friends to display in a Posix-like way.  But they are only hiding what's
>>going on under the hood.
> 
> 
> Sometimes hiding what's going on under the hood is good.  This has the
> side-effect of making most of the "ps ax | grep process" techiniques
> for finding PIDs worthless, unless there's an option on ps I'm missing
> to ID the parent process for its threads.
> 
> I think it's fine and dandy to know how to find out what the threads
> are doing, but for most tasks I just don't need to know, and the
> output gets in the way.
> 
> Does anyone know how to show just the "real" processes?

I doubt there is a way...for the non-POSIX threads they are real 
processes. You might find the "tree display" option of ps useful though, 
e.g., ps fx. I only have 2.6 kernels available right now so I can't test 
it, but I'm guessing threads all show up with one parent process ID on 
ps fx (and likely this is how "patched" apps deal with it).

D. Stimits, stimits AT comcast DOT net





More information about the LUG mailing list