Share with your friends
hdshahin01

Call

In computer science, the fetch-and-add CPU instruction atomically increments the contents of a memory location by a specified value.

That is, fetch-and-add performs the operation

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.