僵尸进程不能被杀死

僵尸进程不能被杀死

本文介绍了僵尸进程不能被杀死的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法杀死僵尸进程?我已经打过电话退出来杀死进程,甚至发送 SIGINT 信号的过程,但它似乎没有什么可以杀死它。我编程的Linux版本。

Is there a way to kill a zombie process? I've tried calling exit to kill the process and even sending SIGINT signal to the process, but it seems that nothing can kill it. I'm programming for Linux.

推荐答案

僵尸进程都已经死了,所以他们不能被杀死,它们只能收获,这必须由其父进程通过等待*()。这通常被称为子收割机成语,在信号处理程序 SIGCHLD

Zombie processes are already dead, so they cannot be killed, they can only be reaped, which has to be done by their parent process via wait*(). This is usually called the child reaper idiom, in the signal handler for SIGCHLD:

while (wait*(... WNOHANG ...)) {
    ...
}

这篇关于僵尸进程不能被杀死的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 16:48