1 Answers
In computer science, the test-and-set CPU instruction is used to implement mutual exclusion in multiprocessor environments. Although a correct lock can be implemented with test-and-set, it can lead to resource contention in busy lock.
To lower the overhead a more elaborate locking protocol test and test-and-set is used.
Given a lock:
Entry protocol is:
7 views
Answered