Last active
October 3, 2017 06:19
-
-
Save lorin/98ebb7d3a52a3d4efacee6474863f3cf to your computer and use it in GitHub Desktop.
Simple increment race condition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXTENDS Naturals | |
CONSTANT N | |
(* | |
--algorithm Increment | |
variable count=0; | |
process Proc \in 1..N | |
variables temp=0, | |
i=0; | |
begin | |
l: while i < N do | |
set: i := i+1; | |
temp := count; | |
inc: count := temp+1; | |
end while | |
end process | |
end algorithm | |
*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment