Fetch&Add vs. Test&Set
•Compare K concurrent
processes using Fetch&Add(I,1) and Test&Set(V)
–The
Fetch&Add distinguishes among and orders the competing processes,
assigning each one a unique number
•Excellent
for allocating work and scheduling
–Test&Set returns the FALSE to at most one of the processes, and so
divides the set of competing processes into two groups, the winner and K-1 others
•Excellent
for mutual exclusion