in Operating System
361 views
0 votes
0 votes

in Operating System
by
361 views

4 Comments

Tag me correctly !

There is a sequence of execution, which leads to BOTH P1 and P2 terminates.

There is a sequence of execution, which leads to P1 terminates but not P2 terminates.

There is NO sequence of execution possible, which leads to P1 not terminates but P2 terminates.

Given answer is right !
1
1
Tag me correctly?
I tagged you correctly, right?
0
0

@Shaik Masthan Also, didn't understand how you concluded all the above statements. Can you please explain further.

0
0

1 Answer

1 vote
1 vote
Here as we can see P1 increases x by 1 and gets out of loop if x>=y. And P2 increases y by 1 and gets out of loop if x==y.

As we can see that P1 can get executed by making x==y, but P2 can not get executed i.e. it will never come out of loop because when x==y then P2 first increases y by 1, making x!=y thus never coming out of loop.

Thus, statement (c) is FALSE.