Solved

Assume the Binary Variable Lock Is Initialized to Be 0

Question 44

Multiple Choice

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions