User`s guide
Cray XMT™ Programming Environment User’s Guide
The Cray XMT compiler recognizes the following generic write functions.
writeef(&v, value)
Writes value in variable v when v is in an empty state and sets v to
a full state. This allows one or more threads waiting for v to change
to a full state to resume execution. If v is in a full state, the write
operation is blocked until v changes to an empty state. This generic
function behaves like a write access to a sync variable.
writeff(&v, value)
Writes value in variable v when v is in a full state and leaves v
in a full state. If v is in an empty state, the write is blocked until v
changes to a full state. This generic function behaves like a write
access to a future variable that occurs outside the body of a future
statement.
writexf(&v, value)
Writes value in variable v and sets v to a full state. This allows
one or more threads waiting for v to change to a full state to resume
execution. This generic function behaves like the write of a return
value that occurs at the end of the body of a future statement but is
not like a write access to a variable declared with the future qualifier.
int_fetch_add(&v, i)
Atomically adds integer i to the value at address v, stores the sum at
v, and returns the original value from v (setting v to a full state).
Regardless of its type, i is cast as an 8-byte integer. Neither
parameter can be a multiword object. If v is less than the size of a
word, the compiler generates a warning diagnostic. If v is an empty
sync or future variable, the operation is blocked until v changes to
a full state.
purge(&v)
Writes 0, using the appropriate data type, to variable v and sets v to
an empty state.
For more information, see the generics(1) man page.
3.2.1.2 Generic Read Functions
Generic read functions return the value for a variable, depending upon the full-empty
state of the variable. When you invoke these functions, the data type of the return
value is determined by the type of the first argument in the function call.
22 S–2479–20