Re: PID sequences

Richard Gooch (rgooch@atnf.CSIRO.AU)
Wed, 25 Feb 1998 15:12:51 +1100

David S. Miller writes:
> Date: Wed, 25 Feb 1998 14:26:33 +1100
> From: Richard Gooch <rgooch@atnf.CSIRO.AU>
> That's a bad way of doing it in the first place. Instead:
> if (getppid () == 1) my_parent_has_died ();
> or:
> ppid = getppid ();
> if (getppid () != ppid) my_parent_has_died ();
> Always remember, often it is more important to consider not what
> applications "should" be doing, but rather what on the whole
> applications and existing code "are" doing.
> To demonstrate the importance of this. Do a sample of piece of UNIX
> userlevel code which in some way uses parent destined signals for one
> reason or another. Determine how many would be tripped up by a pid
> allocation mechanism which recycled pids very fast. How quickly are
> these source bases going to be "fixed" if we start using a PID
> allocation which causes braindamaged situations for them?

Agreed. The point I'd like to make is that I wouldn't want to see the
performance drop significantly just to cater for these broken
applications. These applications are susceptible to PID reuse
anyway. Consider running such an application on a machine which has
another application running that forks lots of processes really
fast. We would just be reducing the MTBF.

However, if it can be done cheaply and easily, then I'd favour
"saving" broken applications. I'm not into crusades to force good
coding in other people's programmes.



To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to