1. A computer-implemented method, comprising: comparing a control value stored in a control location in memory to a specified expected value; and in response to determining that the control value stored in the control location matches the expected value: storing a new value in a data location in memory, wherein the data location and the control location comprise distinct locations in memory; and returning an indication that the new value was successfully stored in the data location; wherein said comparing, said storing, and said returning are performed atomically as part of a software-mediated transaction, such that they appear to take effect together without any intervening change in the value of the data location and without any intervening change in the control value.