• edited by
3,120 views
1 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

2 Answers

2 2 votes

These are 4 possibilities  


 


Hope it will help

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

S3 not possible because if P2 terminate P1 has to terminate..
Position:
Show:

Related questions

2 2 votes
3 3 answers
2.8k
2.8k views
Sambhrant Maurya asked Jan 3, 2019
2,830 views
P1 terminates but P2 does notP2 terminates but P1 does notBoth P1 and P2 terminateNeither P1 nor P2 terminate
0 0 votes
0 0 answers
830
830 views
Hopealways asked Dec 1, 2018
830 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 wrong.
0 0 votes
0 0 answers
856
856 views
Tuhin Dutta asked Oct 2, 2017
856 views
The pic shows the question along with options: