Lab 3

Here is your Lab 3.

Lab 3 is graded and you need to submit your answers to IVLE workbin using the template provided. Please read the instructions carefully.

Lab 3 is due on Friday, 9 September 2011, 11:59pm.

10 thoughts on “Lab 3

  1. Hi prof,

    In question 3, subpart (a) what’s exactly do you mean when you say “What processes constitute the process group created? Which process is the leader?”

    Do we give the process IDs of the processes?

  2. When we run this piece of code:

    for (i = 0; i < 3 ; i ++ )
    {
    if (fork()==0)
    printf("a \n");
    return;
    }

    The output is a.

    However, when change to fork()==1. There is no output.

    Am i right to say that when there is no parent-child process created ( using fork() ), each individual process is deemed as "child" by the system?

    • No, fork returns you the process ID, both to the parent and the child.

      to the parent it passes the id of the child that was created, and to the child it passes 0.

      when you are testing for fork() == 1 you eventually are trying to check whether the process is an init process which is executed during system start.

Leave a Reply

Your email address will not be published. Required fields are marked *