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

The enter_CS ( ) and leave_CS ( ) functions to implement critical section of a process are realized using test-and -set instruction as follows:
Void enter_CS(X)
{
while (test-and-set(X));
}
Void leave_CS(X)
{
X = 0;
}
In the above solution, X is a memory location associated with CS and is initialized to 0. Now consider the following statements
I. The above solution to CS problem is deadlock-free
II. The solution is starvation free.
III. The processes enter CS in FIFO order.
IV. More than one process can enter CS at the same time.

Which of the above statements are TRUE?

A
I and II
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
IV only
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
II and III
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
I only
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Join BYJU'S Learning Program
CrossIcon