The weakest model of consistency for shared memory is local consistency, which requires only that a process observe its own operations in program order, and places no restrictions on how a process sees the operations performed by any other process.

Getting an intuition for how different consistency models behave can be difficult, so I am working on these random little sandboxes to play around with different models. You can edit the program below to play with different operations. As a limitation of my execution enigne, every S-expression is executed atomically, while different expressions may be executed in different orders at each execution. So you might want to run your program multiple times to see how it changes the resulting execution.

There are a few different functions supported:
- (machine statements…) - Defines a node in the distributed program that runs each statement in statements in order
- (put key value) - stores value in global memory at the location specified by key
- (get key) - reads the value from global memory at the location specified by key
- (wait key value) - delays progress in this node until the value in global memory at the location specified by key equals value
- (clk) - displays the vector clock for this machine
- (die) - puts the machine in a failed state, where it makes no more progress

;;;;Define a few machines (machine ; machine 0 (put "data" "bad") (put "data" "good") (put "lock" 1) ) (machine ; machine 1 (wait "lock" 1) (get "data") ) (machine ; machine 2 (wait "lock" 1) (get "data") ) (machine ; machine 3 (wait "lock" 1) (get "data") )

Tags: Projects
Part of a series on Consistency. Interactable.

Leave a comment below! For issues with this website itself, please describe the problem to issues at johnwesthoff dot com.
For urgent questions or comments, shoot me an email (address provided on my GitHub profile).