Process Termination - Minix

This is a discussion on Process Termination - Minix ; Hello, I'm reading a copy of the Minix book (OS Design & Implementation) and under introduction to processes it says: "In some systems, when a process terminates, either voluntarily or otherwise, all processes it created are immediately killed as well. ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Process Termination

  1. Process Termination

    Hello,

    I'm reading a copy of the Minix book (OS Design & Implementation) and
    under introduction to processes it says: "In some systems, when a
    process terminates, either voluntarily or otherwise, all processes it
    created are immediately killed as well. MINIX 3 does not work this
    way, however."

    What are the pros and cons of terminating child processes? Why does
    Minix choose not? Consider the following:

    while(TRUE) {
    write_a_random_file();
    fork();
    }

    This will keep the disk busy indefinitely and because it is constantly
    forking there is no way you can kill all the processes unless you can
    kill the parent (e.g. the terminal window). How do you kill this on
    Minix?

    Does anyone know if Linux works the same way?

    Thanks for the help.

    Cheers,
    Daniel.

  2. Re: Process Termination

    Daniel Carrera escreveu:

    > Hello,
    >
    > I'm reading a copy of the Minix book (OS Design & Implementation) and
    > under introduction to processes it says: "In some systems, when a
    > process terminates, either voluntarily or otherwise, all processes it
    > created are immediately killed as well. MINIX 3 does not work this
    > way, however."


    ??????
    Afaik, on Unix, when someone dies, their children become orphan and are
    adopted by init.

    Btw, "independent" deamons often do:

    void deamonize()
    {
    if ( fork() != 0 )
    exit();
    }

    This way, the shell receives SIGCHILD and goes back to the prompt. The
    forked() process, however, is adopted by init and becomes what we usually
    call a daemon. It still has stdout pointing to the terminal, unless the
    descriptor is closed. However, it's no longer "holding" the shell.

    --
    João Jerónimo

    "Computer are composed of software, hardware, and other stuff terminated
    in "ware", like firmware, tupperware, (...)" - by JJ.

+ Reply to Thread