445 views

Consider the following precedence graph (Fig.6) of processes where a node denotes a process and a directed edge from node $P_{i}$ to node $P_{j}$ implies; that $P_{i}$ must complete before $P_{j}$ commences. Implement the graph using FORK and JOIN constructs. The actual computation done by a process may be indicated by a comment line.

edited | 445 views

+1 vote

Step $1:$

• $P_{1}$
• fork $L_{1}$
• $P_{2}$
• fork $L_{2}$
• $L_{1}:$ fork $L_{2}$
•  $P_{3}$
• goto $L_{3}$

Step $2:$

and

• $L_{2}:$ Join $C_{1}$
• $P_{4}$
• goto $L_{4}$
• $L_{3}:$ Join $C_{2}$
• $P_{5}$
• goto $L_{4}$

Step $3:$

• $L_{4}:$ Join $C_{3}$
• $P_{6}$
by (31 points)
edited
0

@pankaj ,Thank you for the explanation.. here, I am not getting how it is ensuring the direction from P2 to P5. could you please explain ?

0

Can u please explain the method u used. I am a newbie to this.

0

@Arjun Sir,

is this in syllabus now? How to approach these type of question?