emacs-devel
[Top][All Lists]
Advanced

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

Re: proced: ppid of process ID 0 can be 0


From: Eli Zaretskii
Subject: Re: proced: ppid of process ID 0 can be 0
Date: Wed, 24 Dec 2008 20:29:59 +0200

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden,  address@hidden,  address@hidden
> Date: Wed, 24 Dec 2008 11:47:12 -0500
> 
> >> > It's not hypothetical, I've seen such cases and reported them to
> >> > Roland.
> >> What were those cases?
> > Processes that disappeared while Emacs was reading /proc, for example.
> 
> Then don't return them at all

How?  I don't know enough about Linux kernel internals to decide which
attribute's absence means that the process died while Emacs was
reading /proc.  For examples, quite a few lack the command line, but I
don't think that's a good reason to not return such processes.  In
addition, judging by comments in procps sources, the set of attributes
depend on the version of the Linux kernel.  If you (or someone else)
can define a clear logic, one that won't change with the next release
of the kernel, then perhaps we could avoid returning such processes.

Reading /proc is inherently prone to race conditions with the kernel,
unless someone can suggest a way of getting from /proc a consistent
snapshot of the set of system processes.  I don't see how to overcome
this difficulty at the primitive level.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]