edited by
1,473 views
1 votes
1 votes

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

edited by

2 Answers

2 votes
2 votes

These are 4 possibilities  


 


Hope it will help

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

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

Related questions

2 votes
2 votes
3 answers
1
0 votes
0 votes
0 answers
2
Hopealways asked Dec 1, 2018
418 views
In these type of questions “Will we NOT consider CONTEXT SWITCHING unless mentioned???”If context switching is ALLOWED, minimum value will be 8...Correct me if I’m ...