Question: (c) When the following program is executed, the result will be a process tree, which may vary from one run to the other (i) Using

 (c) When the following program is executed, the result will be

(c) When the following program is executed, the result will be a process tree, which may vary from one run to the other (i) Using a diagram, sketch two of the possible process trees than can result if the program were to be executed. (ii) Very briefly, explain why we could have different possible process trees for the same program [You can assume process ID's are integer numbers from 5, 6, 7, Assume no error during the fork0 system call.] 1 2 #include #include #include unistd.h> 4 5 6 7 int main () int k 0; pid t PID; PID=fork ( ) ; if (PID %2 != ) 8 9 break; else print f ("I amXLd, the child of %ld, (long)getpid(), (long)get ppid() ); 12 13 14 return ; (c) When the following program is executed, the result will be a process tree, which may vary from one run to the other (i) Using a diagram, sketch two of the possible process trees than can result if the program were to be executed. (ii) Very briefly, explain why we could have different possible process trees for the same program [You can assume process ID's are integer numbers from 5, 6, 7, Assume no error during the fork0 system call.] 1 2 #include #include #include unistd.h> 4 5 6 7 int main () int k 0; pid t PID; PID=fork ( ) ; if (PID %2 != ) 8 9 break; else print f ("I amXLd, the child of %ld, (long)getpid(), (long)get ppid() ); 12 13 14 return

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!