Question: Question 1 . [ 4 marks ] Consider the execution of the following function ( written in the C language ) . / / all
Question marks
Consider the execution of the following function written in the C language
all the needed headers are included
intmain
intpid;
ifpid fork
printfA;
exit;
printfB;
iffork
printfC;
exit;
printfD;
waitpidpidNULL;
printfE;
exit;
a Draw the process graph for the concurrent program.
In a process graph, each function, including main fork printf waitpid and exit is represented by a vertex. For each vertex, please write the function name below the vertex, and for printf write the output character above the vertex. Assume calling printf will immediately display the content on the screen. Each edge must be directed, with the direction representing the happenbefore relationship.
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
