1.

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-sex (X)); } void leave_CS(X) { X = 0; } In the above solution, X is a memory location associated with the CS and is initialized to 0. Now, consider the following statements : 1. The above solution to CS problem is deadlock-free. 2. The solution is starvation-free. 3. The processes enter CS in FIFO order. 4. More than one processes can enter CS at the same time.Which of the above statements is true?

A. 1 only
B. 1 and 2
C. 2 and 3
D. 4 only
Answer» B. 1 and 2


Discussion

No Comment Found

Related MCQs