Fetch-and-add
In computer science, the fetch-and-add (FAA) CPU instruction atomically increments the contents of a memory location by a specified value.
That is, fetch-and-add performs the operation
- increment the value at address x by a, where x is a memory location and a is some value, and return the original value at x.
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.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.