Fetch-and-add
CPU instruction to increment a value in memory by a given amount / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Fetch-and-add?
Summarize this article for a 10 year old
SHOW ALL QUESTIONS
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.