Despite the concurrent operations, a linearizable execution needs to generate an equivalent global order on the events that is a permutation of Seq, satisfying the semantics of linearizability. More formally, a sequence Seq of invocations and responses is linearizable (LIN) if there is a permutation Seq of adjacent pairs of corresponding events satisfying:1. For every variable v, the projection of Seq on v, denoted Seqv , is such that every Read (adjacent event pair) returns the most recent Write (adjacent event pair) that immediately preceded it.2. If the response op1(resp) of operation op1 occurred before the invocation op2(invoc) of operation op2 in Seq, then op1 (adjacent event pair) occurs before op2 (adjacent event pair) in Seq.Condition 1 specifies that every processor sees a common order Seq of events, and that in this order, the semantics is that each Read returns the most recent completed Write value. Condition 2 specifies that the common order Seq must satisfy the global time order of events, viz., the order of non-overlapping operations in Seq must be preserved in Seq.Examples Figure 12.4 shows three executions:• Figure 12.4(a) The execution is not linearizable because although the Read by P2 begins after Write(x,4), the Read returns the value that existed before the Write. Hence, a permutation Seq satisfying the condition 2 above on global time order does not exist.• Figure 12.4(b) The execution is linearizable. The global order of operations (corresponding to pairs in Seq), consistent with the real-time occurrence, is: Write(y,2), Write(x.4), Read(x,4), Read(y,2).This permutation Seq satisfies conditions 1 and 2.• Figure 12.4(c) The execution is not linearizable. The two dependencies:Read(x,0) before Write(x,4), and Read(y,0) before Write(x,2) cannot both be satisfied in a global order while satisfying the local order of operations at each processor. Hence, there does not exist any permutation Seq satisfying conditions 1 and 2.
đang được dịch, vui lòng đợi..
