Process Ids are generated in such a way that they're unique and tend to either increment, wrapping at some point, or be randomly generated, as far as I can tell. It seems there's a small but real risk that if you get the PID of a process and don't kill it immediately then that process could terminate and the PID be more or less immediately recycled, and you could therefore end up killing the wrong process. I'm not aware of any rule that says the the OS definitely won't reuse a PID within n seconds. Isn't this a risk?