✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
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 the and is initialized to
. The above construct used by process p1 and p2. So above construct ensures ME?
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!