现在的位置: 首页 > 综合 > 正文

僵死进程

2013年12月09日 ⁄ 综合 ⁄ 共 254字 ⁄ 字号 评论关闭
#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)。

抱歉!评论已关闭.