in Operating System retagged by
2,094 views
10 votes

Draw the precedence graph for the concurrent program given below

S1
parbegin
    begin
        S2:S4
    end;
    begin
        S3;
        parbegin
            S5;
            begin
                S6:S8
            end
       parend
   end;
   S7
parend;
S9
in Operating System retagged by
2.1k views

2 Answers

21 votes
 
Best answer

parbegin-parend shows parallel execution while begin-end shows serial execution

selected by

4 Comments

please explain procedure of drawing that instead of directly drawing it , thanks
3
There should be a begin before S1 and end after S9 right ...? If not given, should we take it defaultly ...???
0
S1
parbegin  (parbegin=parallel beginning , after this parallel beginning of S2, S3,S7 started)             
    begin
        S2:S4   (S2:S4  it means S4 occur after S2 in serial order ) 
    end;
    begin           
        S3;
        parbegin    (here S5 and S6 start in parallel order after  the S3  )
            S5;
            begin
                S6:S8   (serial)
            end
       parend       
   end;
   S7
parend;     
S9

conclusion  ,the content between the parbegin and parend start in parallel  and content between begin and end run in serial 

ex given is the subpart of the given module for the expalanation 

 parbegin
       S5;
       begin (after starting S5,S6 in parallel order ,S8 start in serial order after the S6 )
       S6:S8
       end
 parend
4

@Gurdeep Saini nice explanation

1
–4 votes

12.a) picture will be like above. Here perbegin-perend creates when there are more than one child processes, and begin-end creates  a process

1 comment

This above graph is wrong because s7 will run in parallel with first and second begin-end blocks.
7

Related questions