FetchandAdd
Fetch-and-add (FAA) is an atomic read-modify-write operation that returns the value currently stored in a variable and then adds a specified delta to that variable, all in a single, indivisible step. The operation is designed to be atomic with respect to other concurrent accesses to the same variable, so no interleaving can observe a partially updated value.
Typical forms include getting the old value while adding delta (getAndAdd(delta)) or adding delta and then returning
Hardware and language support: Many CPUs provide an atomic fetch-and-add instruction or can implement it with
Limitations and considerations: FAA modifies only one variable atomically and does not by itself synchronize across