CockroachDB's Consistency Model
cockroachlabs.com
cockroachlabs.com
Worth the read just for this.
volatile int a;
a = 1;
print(a) // Could this print Zero?
Even assuming only one program, one thread, one process, no interleaving and nothing fishy, could the final line print 0? In the serializable consistency, the answer is yes. Linearizability is framed in terms of clocks, but really that's just trying to establish that one thing happened before another. The "clock" in this example is the line number.Regardless, could you comment on if and how different linerizable interpretation would be?
Linearizability says that if A happens after B in real time (e.g. you don't start A until you get confirmation that B completed), A must see the effects of B. This would require the print to run after the assignment takes effect.