linux如何在重启期间杀死D状态进程?

时间:2013-12-04 03:29:24

标签: linux reboot

I know ths D status processes is uninterruptable sleep processes. 

很多人说杀死D状态进程就是重启系统。 但重启操作如何能够杀死D状态进程?

我发现“init 0”将最终“杀死-9”所有进程。但是“kill -9”无法杀死D状态进程。

有人告诉我怎么做?

2 个答案:

答案 0 :(得分:9)

根本不会杀死他们。处于D状态的那些过程不会响应任何信号。 kill会产生信号 - 它们无法传递给这些进程。所以,没有杀人。

当内核停止运行时丢失进程上下文不允许任何事情持续存在,进程是内核对象。状态D流程在那时成为历史。

如果你经常看到它通常意味着某种硬件问题,比如cdrom / DVD设备。 D状态表示进程阻塞了设备上的某些不间断操作。

这是一个很好的问题!

答案 1 :(得分:0)

我使用public static int longestSlope(int[][] A, int num) { int max = 0; for (int row = 0; row < A.length; row++) { for (int col = 0; col < A[0].length; col++) { max = Math.max(max, Q3(A, num, row, col, 1)); } } return max; } private static int Q3(int[][] A, int NUM1, int ind1, int ind2, int Step) { if ((ind1 + 1) < A.length && A[(ind1 + 1)][(ind2 + 0)] == A[ind1][ind2] - NUM1) return Q3(A, NUM1, ind1 + 1, ind2, Step + 1); if ((ind1 - 1) >= 0 && A[(ind1 - 1)][(ind2 + 0)] == A[ind1][ind2] - NUM1) return Q3(A, NUM1, ind1 - 1, ind2, Step + 1); if ((ind2 + 1) < A[0].length && A[(ind1 - 0)][(ind2 + 1)] == A[ind1][ind2] - NUM1) return Q3(A, NUM1, ind1, ind2 + 1, Step + 1); if ((ind2 - 1) >= 0 && A[(ind1 + 0)][(ind2 - 1)] == A[ind1][ind2] - NUM1) return Q3(A, NUM1, ind1, ind2 - 1, Step + 1); else return Step; //if a cell next to current index is in the same slop move to that cell and add 1 step } 命令杀死D状态进程。

相关问题