An atomic read-modify-write that returns a flag's old value while setting it. In a sequential consistency model with the flag initially ,
exchange(flag, 1) permits entry only when it returns ; an owner resets the flag to on release. Between releases only one exchange can observe . By contrast, separate read(flag) and write(flag, 1) steps allow both contenders to read before either writes . The indivisibility of the exchange is an assumed primitive, not something proved by writing its steps as ordinary assignments.[ref] Articles by others on the same topic
There are currently no matching articles.