Re: Detecting threads vs processes with ps or /proc

From: Nick LeRoy (
Date: Sun Dec 08 2002 - 22:18:44 EST

On Sunday 08 December 2002 06:24 pm, Albert D. Cahalan wrote:
> Robert Love writes:
> > On Fri, 2002-12-06 at 14:56, Nick LeRoy wrote:
> >> I was considerring doing something like this as well. From your
> >> experience, does it work reliably?
> >
> > It never fails to detect threads (no false negatives).
> Testing the algorithm on idle test processes won't show
> this damn-obvious race condition:
> 1. you read the first thread's info
> 2. the second thread calls mmap() and/or takes a page fault
> 3. you read the second thread's info

Yeah, I thought of that, too. Probably not too likely, of course, but it
still there. Murphy rules.

Robert: Any thoughts on this?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sun Dec 15 2002 - 22:00:13 EST