in Operating System edited by
2,482 views
6 votes
6 votes

Consider the following precedence graph $(\text{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 edited by
2.5k views

1 Answer

4 votes
4 votes
$P_{1}$

        fork $L_{1}$                                      $L_{1}$: Join $C_{1}$

        fork $L_{2}$                                              $P_{4}$

        $P_{2}$                                                      goto $L_{4}$

        fork $L_{1}$

$L_{3}$: Join $C_{2}$                                    $L_{2}$: $P_{3}$

        $P_{5}$                                                     goto $L_{3}$

$L_{4}$: Join $C_{3}$

        $P_{6}$
edited by

13 Comments

@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
0

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

0
0
edited by

@Arjun Sir, @Akash Kanase sir

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

3
3
watch PK BISWAS, IIT KGP NPTEL Lecture, he has. taught FORK JOIN, and yes, it is in syllabus.
0
0

@ankitgupta.1729 I think after the first “fork L2” if we add the line “goto L3”, then P2 to P5 edge will be added correctly (otherwise from P2 we are doing P3 which is wrong). Please correct it.

0
0

@Venky8 Sorry. I forgot all these things related to fork and join constructs. So, I can’t say whether it is correct or not.

1
1
edited by

@ankitgupta.1729 Ok I was referring to answer before edit. Answer is correct now 👍 (Reference 28:00).

2
2

@pankaj borah

after P2

fork L3 should be present.

because L3 will deal with P5.

0
0
edited by
helpful
0
0
edited by

@Pranavpurkar

the above link is of hotstar dude.☺

0
0

@Pranavpurkar   kya baat h bhai...wah

0
0

Lol, @22gate @GateOverflow04 Sorry brother, i think by mistake it happened😂

0
0
ganimat hai k kisi aur website ka nehi dal dya🔞
0
0

Related questions