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, is a memory location associated with the and is initialized to 0. Now consider the following statements:
-
The above solution to problem is deadlock-free
-
The solution is starvation free
-
The processes enter in FIFO order
-
More than one process can enter at the same time
Which of the above statements are TRUE?