擅长:python、mysql、java
<p>当第一次创建子进程时(比如在<code>self.myppid</code>)和<code>self.myppid</code>与<code>getppid()</code>不同时,不能只存储父进程的pid,这意味着父进程已经死亡。</p>
<p>您还可以使用信号来避免继续检查父项是否已更改。我不知道python的具体细节,但是像<a href="http://www.win.tue.nl/~aeb/linux/lk/lk-5.html" rel="nofollow noreferrer">here (at the bottom of the page)</a>这样的描述可能会起作用。</p>