Fetch&Add on Work List
•
Let
TD[1..n]
be a Todo list of TaskIDs
•
Let
Next
be the index of the first unassigned
task
•
Processes execute
•
Fetch&Add(Next, 1)
•
Receive an index back
•
If index
³
n, wrap around => Fetch&Add(Next,-n)
•
Such automatic scheduling can be useful for
rows of an array or other ordered data structure