Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sequential Consistency in Distributed Systems

I am learning Sequential Consistency in Distributed Systems but just could not understand the terms explained. I would appreciate if someone can shed some light in layman's term on why (a) and (c) below are sequentially consistent and (b) is not. Thanks.enter image description here

like image 561
user23 Avatar asked Jun 09 '15 13:06

user23


1 Answers

An execution e of operations is sequentially consistent if and only if it can be permutated into a sequence s of these operations such that:

  • the sequence s respects the program order of each process. That is, for any two operations o1 and o2 which are of the same process and if o1 precedes o2 in e, then o1 should be placed before o2 in s;

  • in the sequence s, each read operation returns the value of the last preceding write operation over the same variable.


For (a), s can be:

W(x)b [P2], R(x)b [P3], R(x)b [P4], W(x)a [P1], R(x)a [P3], R(x)a [P4]

For (c), s can be:

W(x)a [P1], R(x)a [P2], R(x)a [P3], R(x)a [P4], W(x)b [P3], R(x)b [P1], R(x)b [P2], R(x)b [P4]

However, for (b):

  • the operations R(x)b, R(x)a from P3 require that W(x)b come before W(x)a

  • the operations R(x)a, R(x)b from P4 require that W(x)a come before W(x)b

It is impossible to construct such a sequence s.

like image 119
hengxin Avatar answered Oct 10 '22 20:10

hengxin