in Operating System
622 views
0 votes
0 votes

Consider two processes:

Assume x and y are shared variables and initialized to 0. Which statement is true?

A)No mutual exclusion and no deadlock

B)No mutual exclusion but progress satisfies

C)Progress and mutual exclusion both satisfies

D)Mutual exclusion and deadlocks

 

Is A and B both are true??

in Operating System
622 views

4 Comments

Actually here mutual exclusion isnt satisfied as well as there isnt any progress. Moreover, there is no deadlock also.

Mutual exclusion isnt satisfied because both processes X and Y can make shared variables x=1 and y=1 and enter into CS.

Now suppose the situation in which process Y wants to enter the CS but X doesnt want to enter the CS. So x will be 0 and y will be made 1. Since x is not equal to 1, so Y will keep on looping in the outer while loop and wont be able to enter CS until process X makes x=1. So progress isnt satisfied too.
0
0
Only A.

Mutual exclusion is not satisfied as both can enter into critical section and deadlock is not possible.

If Process A executed one time and does not want to enter then it makes X=0.

Now process B cannot enter even the critical section is free. So, Progress is not satisfied.
0
0
Any reason for no deadlock
0
0
Got it
0
0

Please log in or register to answer this question.