in Operating System edited by
1,522 views
1 vote
1 vote

Consider the following ‘C’ code

Assume P1 and P2 are two concurrent processes and sharing the global variables x, y and z. Assignments
and tests are atomic. Consider the following statements :
S1 : P1 and P2 terminates                           S2 : P1 terminates but P2 does not
S3 : P2 terminates but P1 does not            S4 : Neither P1 nor P2 terminates
 

my answer S1 and S4 but solution is different

in Operating System edited by
1.5k views

4 Comments

No answer in solution they have provided a solution for different problem :P
0
0
and you are approaching this wrong diffrent pid means different process id no relation with how any time you write code
0
0

2 Answers

2 votes
2 votes

These are 4 possibilities  


 


Hope it will help

by
0 votes
0 votes
answer could be S1,S2 and S4...

S3 not possible because if P2 terminate P1 has to terminate..

Related questions