105 views 1. P1 terminates but P2 does not
2. P2 terminates but P1 does not
3. Both P1 and P2 terminate
4. Neither P1 nor P2 terminate

edited | 105 views

+1 vote

P1, checking condition and increment value of x atomically. Now x=1 and before checking condition again its preempted.

Now P2 come in focus and checking condition and increment value of y and set value of z atomically. Now y=2 and z=true and before checking condition again its preempted.

Now P1 comes in focus and check while condition again and its true.

therefore both process never terminated.this is true statement. therefore option (D) true.

Now assume that process P2 terminate then process P1 while condition become false because according to P2, it will terminate when while statement false means z = false, and z value will set false when x==y.

Therefore due to P2 P1 also terminate.Now option (c) is also true.

Now when we execute normally then P1 execute first and second time its while condition false and its terminate. but for P2 it doesn't terminate it always increase value of y and set z = true.

Therefore option (A) also true.

But question asked what is false condition, So remaining option is option (B). It means option (B) is false.

therefore option (B) is correct answer.

by (27 points)
What is the answer??
by Junior (827 points)
0
C is the answer???
0
What is false not true asked in question right
0
B is the answer??
0
Why B answer can you explain
0
Yes they've given C as the answer. Can anyone explain?