3. Test-and-Set

Hardware test-and-set instruction (atomic exchange):
  int TestAndSet(int *ptr, int new);
returns the old value and simultaneously updates to the new value.

Correct: yes; Performance: bad (spinning); Fairness: no

Fix performance --> yield; Fix fairness --> queue