You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An interesting question is whether or not we can already implement a compare and swap primitive with the existing syntax of Whiley. My angle of attack on this is to target the multiple assignment statement. Specifically, in a form like this:
A[i], A[j] = A[i], X
The key here is that, if i == j, then the above assigns X to A[i] otherwise A[i] is untouched. This is somehow a compare and set. We could have some definitions like this:
uint lock[NTHREADS]
uint HOLDER = 0
native uint THIS where THIS != HOLDER && THIS < NTHREADS
Don't quite know how to exploit this observation yet
The text was updated successfully, but these errors were encountered:
An interesting question is whether or not we can already implement a compare and swap primitive with the existing syntax of Whiley. My angle of attack on this is to target the multiple assignment statement. Specifically, in a form like this:
The key here is that, if
i == j
, then the above assignsX
toA[i]
otherwiseA[i]
is untouched. This is somehow a compare and set. We could have some definitions like this:Don't quite know how to exploit this observation yet
The text was updated successfully, but these errors were encountered: