The Gateway to Computer Science Excellence
+3 votes
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.

in Operating System by Boss (30.8k points)
edited by | 445 views

1 Answer

+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 by
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, @Akash Kanase sir

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

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,370 answers
198,506 comments
105,275 users