Re: [RFC] ps command race fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hmm...  I forgot to hit send.

KAMEZAWA Hiroyuki <[email protected]> writes:

> At first, Thanks.
>
> question:
>
> 	task = get_pid_task(find_next_pid(tgid), PIDTYPE_PID);
>
> Does this return only "task/process" ? and never return "thread" ?

Good point.  I don't think I'm filter for thread group leaders here.
That should take a couple more lines of code.

> My another concern is that newly-created-process while ps running cannot be
> catched
> by this kind of "table walking" approach (as my previous work)
> But if people say O.K, I have no complaint.

Well it can but only if the newly created processes have a higher pid.

The guarantee that POSIX readdir makes is that you will see all directory
entries that are neither added nor deleted during the readdir.

> I(we)'ll post another list-based one in the next week, anyway.
> (I can't go-ahead this week...)

Where I see what I'm doing as being superior to that is that I'm
not writing to any global data structures.  Which means what I'm doing
should scale to large machines without problem.

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux