Skip to content

Instantly share code, notes, and snippets.

@lorin
Last active October 3, 2017 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorin/98ebb7d3a52a3d4efacee6474863f3cf to your computer and use it in GitHub Desktop.
Save lorin/98ebb7d3a52a3d4efacee6474863f3cf to your computer and use it in GitHub Desktop.
Simple increment race condition
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