588 views
0 votes
0 votes

Consider the methods used by processes PI and P2 for accessing their critical sections.

The initial values of shared Boolean variables S, and S2 are randomly assigned,

P1

while (SI = = S2);

critical section

S1= S2;

P2

while (SI = = S2);

critical section

S1 = S2;

Which one of the following statements describes the properties achieved ?

(A) Mutual exclusion but not progress

(B) Progress but not mutual exclusion

(C) Neither mutual exclusion nor progress

(D) Both mutual exclusion and progress

2 Answers

0 votes
0 votes

Let s1!=s2

both P1 and P2 can go to CS, So  No Mutual Exclusion.

Let s1==s2

P1 tries and got blocked, P2 tries- got blocked - Deadlock

No process is in a condition such that it can go to CS.

So No Progress.

0 votes
0 votes
When (s1==s2) no process enter into critical section means there's deadlock
When (s1==S2) means s1and S2 have different value in such case  both process P1 and P2 can enter in the critical section hence there's no mutual exclusion

Option C match here

Related questions

0 votes
0 votes
2 answers
1
shivajikobardan asked Jul 22, 2023
801 views
Sorry if this is a stupid question. But it really intrigued me. Same resources at different algorithms are telling different ways to test these stuffs.Here's an algorith...
0 votes
0 votes
1 answer
3