Wikipedia
Fetch-and-add
In computer science, the fetch-and-add CPU instruction that atomically modifies the contents of a memory location. That is, fetch-and-add performs the operation
set to , where is a memory location and is some value,in such a way that if this operation is executed by one process in a concurrent system, no other process will ever see an intermediate result. Fetch-and-add can be used to implement concurrency control structures such as mutex locks and semaphores.