Question: ( 1 % Below is the test _ fork.c file which creates 3 different types of topologies of the processes ( linear , Binary tree
Below is the testfork.c file which creates different types of topologies of the processes
linear Binary tree and star topology Save the code in a file and name it testforktoplogies.c
compile and run it Note down the output for each topology and create graphs for each. For
example, for star topology, the graph will look something like this:
For the graphs, use the output trom the command window and understand the flow to create the
graphs. Write down your description of the flow generated from each topology. Do not exceed For the graphs, use the output from the command window and understand the flow to create the
graphs. Write down your description of the flow generated from each topology. Do not exceed
the length to more than page. You will need to pay close attention to the exit and wait
commands in the code to understand the flow:
#include childpid getpid;
parentpid getppid;
printf Child Process ID: d parent process ID: dln childpid, parentpid;
exit;
waitNULL;
printfInStar topology of processes:
for int ;;
if fork
childpid getpid;
parentpid getppid;
printChild Process ID: d parent process ID: dln childpid, parentpid;
exit;
for int ;;
waitNULL;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
