CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following proposed solution for the critical section problem. There are n processes: P0...Pn1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.
Code for Pi;
do
{
c[i]=1,t[i]=pmax(t[0],...,t[n-1])+1;c[i]=0;
for every ji in {0,..., n-1}
{ while (c[j]);
while (t[j]!=0&&t[j]<=t[i]);
}
Critical Section; t[i] = 0;
Remainder Section;
} while (true);

Which one of the following is TRUE about the above solution?

A
It cannot cause a deadlock
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
The progress condition is satisfied
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
The bounded wait condition is satisfied
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
At most one process can be in the critical section at any time
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Open in App
Solution

The correct option is D At most one process can be in the critical section at any time
It satisfies the mutaul exclusion, so only one process can be in the critical section at any time.

flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Critical Section Problem and Conditions
OTHER
Watch in App
Join BYJU'S Learning Program
CrossIcon