Atomic Add (ATMCADD)

Bound program access

Built-in number for ATMCADD4 is 671. ATMCADD4 ( op1 : address of a signed binary(4) value (has alignment restrictions - see description below) op2 : signed binary(4) value ) : signed binary(4)

Built-in number for ATMCADD8 is 672. ATMCADD8 ( op1 : address of a signed binary(8) value (has alignment restrictions - see description below) op2 : signed binary(8) value ) : signed binary(8)

Description  Atomically increments the value pointed to by op1 by the value op2. Returns the original value pointed to by op1.

The value pointed to by op1 and the op2 value must have the same length. Failure to have the operands the same length will not be detected and the results of the instruction are undefined when this occurs.

The first operand must be aligned based on its length:

Failure to have the first operand aligned properly will not be detected, but the results of the instruction are undefined when this occurs.

The arithmetic performed by this instruction will not signal any exceptions.

This operation is useful when a variable is shared between two or more threads. When updating such a variable, it is important to make sure that the entire operation is performed atomically (not interruptible). See Atomicity for additional information.

The primary purpose of this instruction is to manipulate a variable which is shared by two or more threads, but this instruction does not synchronize storage. When sharing more than one variable between multiple threads or processes, be aware of storage synchronization issues. See Storage Synchronization Concepts for additional information.

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

10 Damage Encountered

1C Machine-Dependent

20 Machine Support

22 Object Access

24 Pointer Specification

2C Program Execution

36 Space Management

44 Protection Violation