僵死进程

#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
int main()
{
pid_t pid;
if((pid = fork()) == 0){
printf("child[%d]\n", getpid());
exit(0);
}

sleep(10);
printf("parent[%d]\n", getpid());
return 0;
}

一个子线程已经终止,但是其 父进程尚未对其进行善后处理(获取终止子进程的有关信息,释放它仍占用的资源)的进程称为 僵尸进程(zombie)。



你可能感兴趣的:(僵死进程)