Assume the binary variable lock is initialized to be 0, which of the following can be an implementation of the entry section to solve the critical-section problem?
A) while (compare and swap(&lock, 0, 1) != 0) , do nothing;
B) while (test and set(&lock) ) , do nothing;
C) both A and B
D) none of the above
Correct Answer:
Verified
Q6: Which of the following is true for
Q7: Which of the following actions should be
Q8: Which of the following variables are shared
Q9: Which of the following critical-section problem's requirements
Q10: Which of the following is true regarding
Q12: Which of the following indicates that Pi
Q13: Which of the following is a software-based
Q14: Which of the following is not true
Q15: Which of the following critical-section problem's requirements
Q16: Which of the following solutions needs hardware
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents