edited by
2,415 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.

edited by

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

Related questions

0 votes
0 votes
0 answers
2
10 votes
10 votes
2 answers
4
Kathleen asked Sep 13, 2014
3,472 views
Draw the precedence graph for the concurrent program given belowS1 parbegin begin S2:S4 end; begin S3; parbegin S5; begin S6:S8 end parend end; S7 parend; S9