僵尸进程zombie与孤儿进程orphan

简介:

问题提出


  以前在学习《unix环境高级编程》进程时候,提到孤儿进程和僵尸进程,但是一直对这两个概念比较模糊。于是今天做了一些测试程序,并把这些记录下来.

  僵尸进程/僵死进程
In UNIX System terminology, a process that has terminated,but whose parent has not yet waited for it, is called a zombie.
在UNIX 系统中,一个进程结束了,但是他的父进程没有等待(调用wait / waitpid)他, 那么他将变成一个僵尸进程。
但是如果该进程的父进程已经先结束了,那么该进程就不会变成僵尸进程, 因为每个进程结束的时候,系统都会扫描当前系统中所运行的所有进程, 看有没有哪个进程是刚刚结束的这个进程的子进程,如果是的话,就由Init 来接管他,成为他的父进程, 这样的进程就是下面的孤儿进程.

  孤儿进程
相反,如果一个父进程退出,而它的一个或多个子进程还在运行,那么那些子进程将成为孤儿进程。孤儿进程将被init进程(进程号为1或者0)所收养,并由init进程对它们完成状态收集工作。

僵尸进程将会导致资源浪费,而孤儿进程不会。

僵尸进程和孤儿进程


  我们知道在unix/linux中,正常情况下,子进程是通过父进程创建的,子进程在创建新的进程。子进程的结束和父进程的运行是一个异步过程,即父进程永远无法预测子进程 到底什么时候结束。 当一个 进程完成它的工作终止之后,它的父进程需要调用wait()或者waitpid()系统调用取得子进程的终止状态。

  孤儿进程:一个父进程退出,而它的一个或多个子进程还在运行,那么那些子进程将成为孤儿进程。孤儿进程将被init进程(进程号为1)所收养,并由init进程对它们完成状态收集工作。

  僵尸进程:一个进程使用fork创建子进程,如果子进程退出,而父进程并没有调用wait或waitpid获取子进程的状态信息,那么子进程的进程描述符仍然保存在系统中。这种进程称之为僵死进程。

问题的产生


  由于子进程的结束和父进程的运行是一个异步过程,即父进程永远无法预测子进程到底什么时候结束.

  那么会不会因为父进程太忙来不及wait子进程,或者说不知道子进程什么时候结束,而丢失子进程结束时的状态信息呢?

  这种机制就是: 在每个进程退出的时候,内核释放该进程所有的资源,包括打开的文件,占用的内存等。但是仍然为其保留一定的信息(包括进程号the process ID,退出状态the termination status of the process,运行时间the amount of CPU time taken by the process等)。直到父进程通过wait / waitpid时才释放.

但这样就导致了问题,我们一般Unix系统中,多进程使用的分叉fork并不保证父子进程的执行顺序(vfork的父进程与子进程是共用地址空间的,子进程会先运行,但是vfork是被废弃掉的调用,BSD里引入它是想避免fork时拷贝父进程的地址空间。所以使用vfork的正常行为是让子进程马上调用exec系列函数。但现在使用写时拷贝,一般不会用vfork了).

由于父子进程运行的顺序是不定的,那么结束的时候也不能确定.因此会出现如下两种情况
①父进程先结束,那么子进程由init进程接管,负责子进程的善后工作,子进程成功孤儿进程.
②子进程先结束,而父进程并没有调用wait或waitpid获取子进程的状态信息,那么子进程的进程描述符仍然保存在系统中,但是成为”黑户”,并不被init所知,更不能被接管,成为僵死进程。
可见如果父进程进程不调用wait / waitpid的话,那么保留的子进程那段信息就不会释放,其进程号就会一直被占用,但是系统所能使用的进程号是有限的,如果大量的产生僵死进程,将因为没有可用的进程号而导致系统不能产生新的进程. 此即为僵尸进程的危害,应当避免。

  孤儿进程是没有父进程的进程,孤儿进程这个重任就落到了init进程身上,init进程就好像是一个民政局,专门负责处理孤儿进程的善后工作。每当出现一个孤儿进程的时候,内核就把孤儿进程的父进程设置为init,而init进程会循环地wait()它的已经退出的子进程。这样,当一个孤儿进程凄凉地结束了其生命周期的时候,init进程就会代表党和政府出面处理它的一切善后工作。因此孤儿进程并不会有什么危害。

  任何一个子进程(init除外)在exit()之后,并非马上就消失掉,而是留下一个称为僵尸进程(Zombie)的数据结构,等待父进程处理。这是每个子进程在结束时都要经过的阶段。如果子进程在exit()之后,父进程没有来得及处理,这时用ps命令就能看到子进程的状态是“Z”。如果父进程能及时处理,可能用ps命令就来不及看到子进程的僵尸状态,但这并不等于子进程不经过僵尸状态。 如果父进程在子进程结束之前退出,则子进程将由init接管。init将会以父进程的身份对僵尸状态的子进程进行处理。

僵尸进程的危害


 
例如有个进程,它定期的产 生一个子进程,这个子进程需要做的事情很少,做完它该做的事情之后就退出了,因此这个子进程的生命周期很短,但是,父进程只管生成新的子进程,至于子进程 退出之后的事情,则一概不闻不问,这样,系统运行上一段时间之后,系统中就会存在很多的僵死进程,倘若用ps命令查看的话,就会看到很多状态为Z的进程。 严格地来说,僵死进程并不是问题的根源,罪魁祸首是产生出大量僵死进程的那个父进程。因此,当我们寻求如何消灭系统中大量的僵死进程时,答案就是把产生大量僵死进程的那个元凶枪毙掉(也就是通过kill发送SIGTERM或者SIGKILL信号啦)。枪毙了元凶进程之后,它产生的僵死进程就变成了孤儿进程,这些孤儿进程会被init进程接管,init进程会wait()这些孤儿进程,释放它们占用的系统进程表中的资源,这样,这些已经僵死的孤儿进程 就能瞑目而去了。

示例程序


孤儿进程


/*************************************************************************
    > File Name: orphan.c
    > Author: GatieMe
    > Mail: gatieme@163.com
    > Created Time: 2015年12月10日 星期四 19时45分16秒
 ************************************************************************/


#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>

#include <sys/types.h>


/**
 *   在这个程序中
 *   我们先在程序FROK一个子进程
 *   然后父进程等待1S,
 *   等待子进程打印出自己的PID, 和父进程的PID
 *   随后父进程立马退出
 *
 *   然后子进程在打印出自己和父进程的PID后
 *   睡眠5S, 以保证父进程先退出
 *   此时子进程成为孤儿进程, 由init接管
 *   然后在自己苏醒之后, 再打印出自己的PID和父进程的PID
 *
**/

int main()
{
    pid_t pid;

    //创建一个进程
    pid = fork();

    if(pid < 0)   //  FROK创建进程失败时返回-1
    {
        printf("fork error errno = %d:%s", errno , strerror(errno));
        exit(1);
    }
    else if(pid == 0)      //  FROK在子进程中返回0
    {
        printf("child  %d : I am the child process...\n", getpid( ));

        //  输出子进程ID和父进程ID
        printf("child  %d : pid =  %d, ppid = %d\n", getpid(), getpid(), getppid());


        //  睡眠5s,保证父进程先退出
        printf("child  %d : I will sleep five seconds.\n", getpid());
        sleep(5);

        printf("pid =  %d, ppid = %d\n", getpid(), getppid());
        //输出进程信息
        system("ps -o pid,ppid,state,tty,command");
        printf("child process is exited.\n");
        //exit(0);
    }
    else                //  FROK在父进程中返回子进程的pid
    {

        printf("parent %d : I am the parent process...\n", getpid());
        printf("parent %d : pid =  %d, ppid = %d\n", getpid(), getpid(), getppid());

        //  父进程睡眠1s,保证子进程输出进程id
        sleep(1);
        printf("father process is  exited.\n");

    }
    return 0;
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75

孤儿进程

在这个程序中
父进程退出前,父进程pid=10452,子进程pid=10453
父进程退出后,父进程pid=1792,子进程pid=10453
可以由于是在终端中运行,因此我们的init进程并不是主的init进程,而是user的init进程.
这个很容易理解,我们的程序并不是运行在系统的shell中,而是运行在bash中.
如果进入ctrl+alt+F1,进入命令行中,再次运行程序,就可以看到子进程成为孤儿进程后,父进程成为init[pid = 1]

僵尸进程


下面我们修改代码,让子进程直接退出.

/*************************************************************************
    > File Name: zombie1.c
    > Author: GatieMe
    > Mail: gatieme@163.com
    > Created Time: 2015年12月10日 星期四 19时45分16秒
 ************************************************************************/


#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>

#include <sys/types.h>


/**
 *   在这个程序中
 *   我们先在程序FROK一个子进程
 *   然后
 *
**/

int main()
{
    pid_t pid;

    //创建一个进程
    pid = fork();

    if(pid < 0)   //  FROK创建进程失败时返回-1
    {
        printf("fork error errno = %d:%s", errno , strerror(errno));
        exit(1);
    }
    else if(pid == 0)      //  FROK在子进程中返回0
    {
        printf("child  %d : I am the child process...\n", getpid( ));

        //  输出子进程ID和父进程ID
        printf("child  %d : pid =  %d, ppid = %d\n", getpid(), getpid(), getppid());

        printf("child process is exited [zombie]....\n");
        //exit(0);
    }
    else                //  FROK在父进程中返回子进程的pid
    {

        printf("parent %d : I am the parent process...\n", getpid());
        printf("parent %d : pid =  %d, ppid = %d\n", getpid(), getpid(), getppid());

        //  父进程睡眠5s,保证子进程退出
        printf("parent %d : I will sleep 5 seconds...\n", getpid());
        sleep(5);
        system("ps -o pid,ppid,state,tty,command");
        //printf("father process is  exited.\n");

    }
    return 0;
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62

僵尸进程

僵尸进程的危害


下面这个程序中,我们将在父进程中循环产生僵尸进程.

/*************************************************************************
    > File Name: zombie1.c
    > Author: GatieMe
    > Mail: gatieme@163.com
    > Created Time: 2015年12月10日 星期四 19时45分16秒
 ************************************************************************/


#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>

#include <sys/types.h>


/**
 *   在这个程序中
 *   父进程每隔5s就将产生一个僵尸进程
**/

int main()
{
    pid_t pid;

    while( 1 )
    {
        //创建一个进程
        pid = fork();

        if(pid < 0)   //  FROK创建进程失败时返回-1
        {
            printf("fork error errno = %d:%s", errno , strerror(errno));
            exit(1);
        }
        else if(pid == 0)      //  FROK在子进程中返回0
        {
            printf("child  %d : I am the child process...\n", getpid( ));

            //  输出子进程ID和父进程ID
            printf("child  %d : pid =  %d, ppid = %d\n", getpid(), getpid(), getppid());

            printf("child process is exited [zombie]....\n\n");

            //  注意子进程需要退出exit
            //  要不然会子进程也进入循环疯狂的创建子进程
            exit(0);
        }
        else                //  FROK在父进程中返回子进程的pid
        {

            printf("parent %d : I am the parent process...\n", getpid());
            printf("parent %d : pid =  %d, ppid = %d\n", getpid(), getpid(), getppid());

            //  父进程睡眠5s,保证子进程退出
            printf("parent %d : I will sleep 5 seconds...\n\n", getpid());
            sleep(5);
            system("ps -o pid,ppid,state,tty,command");
            printf("father process is  exited.\n");
        }
    }
    return 0;
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65

僵尸进程的危害

解决僵尸进程


/*************************************************************************
    > File Name: nozombie.c
    > Author: GatieMe
    > Mail: gatieme@163.com
    > Created Time: 2015年12月10日 星期四 19时45分16秒
 ************************************************************************/


#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <signal.h>

#include <sys/wait.h>
#include <sys/types.h>




void signal_child(int signo)
{
     pid_t          pid;
     int            state;

     //处理僵尸进程
     while((pid = waitpid(-1, &state, WNOHANG)) > 0)
     {
         printf("\n==child %d terminated.==\n\n", pid);
     }
     return ;
}

/**
 *   在这个程序中
 *   父进程产生一个僵尸进程
 *   在子进程退出后, 将信号SIGCHLD
 *   而父进程中注册了信号SIGCHLD的信号处理函数
 *   在信号处理函数中, 将使用waitpid子进程
**/
int main()
{
    pid_t pid;

    //  注册信号SIGCHLD的处理函数
    //  当子进程退出时, 此信号将被触发
    signal(SIGCHLD, signal_child);
    //创建一个进程
    pid = fork();

    if(pid < 0)   //  FROK创建进程失败时返回-1
    {
        printf("fork error errno = %d:%s", errno , strerror(errno));
        exit(1);
    }
    else if(pid == 0)      //  FROK在子进程中返回0
    {
        printf("child  %d : I am the child process...\n", getpid( ));

        //  输出子进程ID和父进程ID
        printf("child  %d : pid =  %d, ppid = %d\n", getpid(), getpid(), getppid());

        printf("child  %d :process is exited [not zombie]....\n\n", getpid());

        //  注意子进程需要退出exit
        //  要不然会子进程也进入循环疯狂的创建子进程
        exit(0);
    }
    else                //  FROK在父进程中返回子进程的pid
    {

        printf("parent %d : I am the parent process...\n", getpid());
        printf("parent %d : pid =  %d, ppid = %d\n", getpid(), getpid(), getppid());

        //  父进程睡眠5s,保证子进程退出
        printf("parent %d : I will sleep 5 seconds...\n\n", getpid());
        sleep(5);

        system("ps -o pid,ppid,state,tty,command");
    }

    return 0;
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85

解决僵尸进程

子进程成为孤儿进程–fork两次

  《Unix 环境高级编程》中非常详细。原理是将子进程成为孤儿进程,从而其的父进程变为init进程,通过init进程可以处理僵尸进程

在这个方法中,我们第一次创建的进程只是一个过渡进程,它在创建了第二个进程后就立即消亡,从而使第二个进程成为一个孤儿进程,由init接管.

而我们通过让原进程wait第一个进程来保证第一个进程不会成为僵死进程
由于第一个进程没做任何操作,便立即退出,因此源进程wait第一个进程的花销几乎可以不计.

因此如果一个进程要fork一个子进程,但不要求它等待子进程终止,也不希望子进程处于僵死状态直到父进程终止,可以使用这种方法.

在这种方法中,父进程和第二个子进程才是真正工作的进程,而第一个子进程只是用于fork第二个子进程的一个过渡进程,通过它使父进程和第二个子进程的不存在直接的父子关系,从而避免了僵死进程的产生.

/*************************************************************************
    > File Name: zombietoorphan.c
    > Author: GatieMe
    > Mail: gatieme@163.com
    > Created Time: 2015年12月10日 星期四 22时49分02秒
 ************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>

#include <sys/types.h>
#include <sys/wait.h>

/**
 * 如果一个进程要frok一个子进程,但不要求它等待
 * 子进程终止,也不希望子进程处于僵死状态直到父进程终止,
 * 实现这一要求的诀窍是调用fork两次
 **/
int main()
{
    pid_t  pid;

    if((pid = fork( )) < 0)        // 父进程中创建子进程
    {
        perror("fork error:");
        exit(-1);
    }
    else if(pid == 0)          //  第一个子进程中
    {
        printf("first child  %d : pid = %d, ppid = %d\n",getpid( ), getpid( ),getppid( ));

        /**
         *  在子进程中
         *  我们再次fork产生第二个子进程
         *  然后第二个子进程在等待其父进程(第一个子进程)退出后再退出
         *  这样第二个子进程成为孤儿进程, 由init接管它
         **/
        if((pid = fork( )) < 0)    //  子进程中再创建子进程
        {
            perror("fork error:");
            exit(-1);
        }
        else if(pid > 0)        //  第一个子进程直接退出
        {
            printf("first child %d : is exited.\n", getpid( ));
            exit(0);
        }
        else                    //  第二子进程在其父进程第一个子进程退出后再退出
        {
            printf("second child %d : pid = %d, ppid = %d\n", getpid( ), getpid( ), getppid( ));
            printf("second child %d : I will sleep 3 second...\n", getpid());

            //  睡眠3s保证第一个子进程退出,这样第二个子进程的父亲就是init进程里
            sleep(3);

            ////////////////////////////////////////////////////////////////////
            //
            // 第二个进程才是我们真正创建出来期望工作的进程
            //
            ////////////////////////////////////////////////////////////////////
            printf("\nsecond child %d : pid = %d, ppid = %d\n\n", getpid( ), getpid( ), getppid( ));
            system("ps -o pid,ppid,state,tty,command");
            exit(0);
        }
    }

    //父进程处理第一个子进程退出
    if (waitpid(pid, NULL, 0) != pid)
    {
        perror("waitepid error:");
        exit(1);
    }
    exit(0);
    return 0;
}


  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79

这里写图片描述


转载:http://blog.csdn.net/gatieme/article/details/50253481

目录
相关文章
|
6月前
|
Linux
孤儿进程,守护进程,僵尸进程
孤儿进程,守护进程,僵尸进程
41 0
|
27天前
|
Linux Shell 调度
【Linux】进程排队的理解&&进程状态的表述&&僵尸进程和孤儿进程的理解
【Linux】进程排队的理解&&进程状态的表述&&僵尸进程和孤儿进程的理解
|
3月前
|
Linux 调度
『 Linux 』僵尸进程与孤儿进程
『 Linux 』僵尸进程与孤儿进程
|
4月前
|
Linux 调度 Apache
孤儿僵尸守护进程的简单理解
孤儿僵尸守护进程的简单理解
24 0
|
4月前
|
Linux 调度
【Linux系统化学习】进程的状态 | 僵尸进程 | 孤儿进程
【Linux系统化学习】进程的状态 | 僵尸进程 | 孤儿进程
【Linux系统化学习】进程的状态 | 僵尸进程 | 孤儿进程
|
5月前
|
Unix Linux
unix高级编程-僵尸进程和孤儿进程
unix高级编程-僵尸进程和孤儿进程
37 0
|
6月前
|
Linux Shell 程序员
【Linux】进程状态|僵尸进程|孤儿进程
【Linux】进程状态|僵尸进程|孤儿进程
|
8月前
|
Linux Shell
【Linux取经路】探索进程状态之僵尸进程 | 孤儿进程(二)
【Linux取经路】探索进程状态之僵尸进程 | 孤儿进程(二)
65 1
|
8月前
|
存储 算法 Linux
【Linux取经路】探索进程状态之僵尸进程 | 孤儿进程(一)
【Linux取经路】探索进程状态之僵尸进程 | 孤儿进程(一)
80 0
孤儿进程、僵尸进程和进程退出(通俗易懂)
孤儿进程、僵尸进程和进程退出(通俗易懂)

相关实验场景

更多