CDS

CDS returns a FIXED BINARY(31) value that indicates if the old and current values in a compare double and swap were equal.

Read syntax diagramSkip visual syntax diagram
>>-CDS(p,q,x)--------------------------------------------------><

p
Address of the old FIXED BINARY(63) value.
q
Address of the current FIXED BINARY(63) value.
x
The new FIXED BINARY(63) value.

CDS compares the "current" and "old" values. If they are equal, the "new" value is copied over the "current", and a value of 0 is returned. If they are unequal, the "current" value is copied over the "old", and a value of 1 is returned.

On z/OS, the CDS built-in function implements the CDS instruction. For a detailed description of this function, read the appendices in the Principles of Operations manual.

On Intel, the CDS built-in function uses the Intel cmpxchg8 instruction in the same manner that the CS built-in function uses the cmpxchg4 instruction.






Published: 23 December 2018