Presentation is loading. Please wait.

Presentation is loading. Please wait.

Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation.

Similar presentations


Presentation on theme: "Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation."— Presentation transcript:

1 Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation on the object takes effect in zero time, and the result is “equivalent to” some legal sequential computation. W (x:=0)R (x=1) W (x:=1) R(x=1) (Initially x=y=0) W (x:=0) Is this acceptable? It violated linearizability

2 Linearizability A trace is consistent, when every read returns the latest value written into the shared variable preceding that read operation. A trace is linearizable, when (1) it is consistent, and (2) the temporal ordering among the reads and writes is respected. W (x:=0)R (x=1) W (x:=1) R(x=1) (Initially x=y=0) W (x:=0)

3 Sequential consistency Some interleaving of the local temporal order of events at the different replicas is a consistent trace. W(x:=100) W(x:=99] R(x=100) R(x=99)

4 Sequential consistency Is sequential consistency satisfied here? W(x:=10) W(x:=8] W(x=20) R(x=20) R(x:=10) R(x=10)

5 Causal consistency All writes that are causally related must be seen by every process in the same order. W(x:=10) W(x:=20) R(x=10)R(x=20) R(x=10)

6 Implementing consistency models Cost (i.e message complexity) of implementation decreases as the models become weaker.

7 Implementing linearizability Read X W(x:=10) W(x:=20) Needs total order multicast of all reads and writes

8 Implementing linearizability The total order broadcast forces every process to accept and handle all reads and writes in the same temporal order. The peers update their copies in response to a write, but only send acknowledgements for reads. After this, the local copy is returned

9 Implementing sequential consistency Use total order broadcast all writes only, but immediately return local copies for reads.

10 Exercise Let x, y be two shared variables Process PProcess Q { initially x=0}{ initially y=0} x :=1;y:=1; if y=0  x:=2 fi ; if x=0  y:=2 fi ; Print xPrint y If sequential consistency is preserved, then what are the possible values of the printouts? List all of them.

11 Client centric consistency model

12 Read-after-read If read from A is followed by read from B then the second read should return a data that is as least as old the previous read. A B

13 Client centric consistency model Read-after-write Each process must be able to see its own updates. Consider updating a webpage. If the editor and the browser are not integrated, the editor will send the updated HTML page to the server, but the browser may return an old copy of the page when you view it To implement this consistency model, the editor must invalidate the cached copy, forcing the browser to fetch the recently uploaded version from the server.

14 Client centric consistency model Write-after-read Each write operation following a read should take effect on the previously read copy, or a more recent version of it.x=0 x:=20 x:= x+ 5 x=5?

15 Qorum-based protocols A quorum system engages only a designated minimum number of the replicas for every read or write operation – this number is called the read or write quorum. When the quorum is not met, the operation (read or write) ispostponed

16 Quorum-based protocols To successfully write, update > N/2 of them, and tag it with the new sequence or version number. To successfully read, access at least N/2 replicas with identical values or version numbers. Otherwise, abandon the read Thomas rule N = no of replicas.

17 Quorum-based protocols After a partition, only the larger segment runs the consensus protocol. The smaller segment contains stale data, until the network is repaired. Ver.0 Ver.1

18 Quorum-based protocols

19 Asymmetric quorum: W + R > N W > N/2 No two writes overlap No read overlaps with a write.


Download ppt "Linearizability Linearizability is a correctness criterion for concurrent object (Herlihy & Wing ACM TOPLAS 1990). It provides the illusion that each operation."

Similar presentations


Ads by Google