我从一个Python脚本产卵5个不同的工艺死亡,就像这样:杀子进程父是在Python
p = multiprocessing.Process(target=some_method,args=(arg,))
p.start()
我的问题是,当,不知何故父进程(主脚本)得到死亡,子进程继续运行。
当父母死亡时,是否有办法杀死像这样产生的子进程?
编辑: 我想这一点:
p = multiprocessing.Process(target=client.start,args=(self.query_interval,))
p.start()
atexit.register(p.terminate)
但这似乎并不奏效
重复? http://stackoverflow.com/questions/14128410/killing-child-process-when-parent-crashes-in-python – theAlse 2014-08-28 06:40:46
我已经通过这篇文章,它具体谈论'popen'和子流程 – 2014-08-28 06:42:07
如何父进程被杀害? – Korem 2014-08-28 07:14:52