Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
436 views
in Computer by (106k points)
closed by

Consider the methods used by processes P1 and P2 for accessing their critical sections whenever needed, as given below. The initial values of shared boolean variables S1 and S2 are randomly assigned.

Method used by PI

Method used by P2

While (S1 == S2);

Critical Section

S1 = S2;

While (S1 != S2);

Critical Section

S2 = not (S1);

 

Which one of the following statements describes the properties achieved?


1. Mutual exclusion but not progress
2. Progress but not mutual exclusion
3. Neither mutual exclusion nor progress
4. Both mutual exclusion and progress

1 Answer

0 votes
by (106k points)
selected by
 
Best answer
Correct Answer - Option 1 : Mutual exclusion but not progress

The given mechanism is based on strict alternation, which guarantees always mutual exclusion and never progress.

In this mutual exclusion is satisfied because at any point of time either S1=S2 or S1 != S2, but not both. But here progress is not satisfied because suppose S1=1 and S2=0 and P1 is not interested to enter into the critical section but P2 wants to enter into the critical section, and P2 will not be able to enter, because until P1 will not enter the critical section, S1 will not become equal to S2. So if one process is not interested in entering the critical section, it will not allow the other process to enter the critical section which is interested. So progress is not satisfied.

Hence the correct answer is Mutual exclusion but not progress.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...