Difference between Linearizability and Serializability

原文:http://stackoverflow.com/questions/8200015/what-is-the-difference-between-serializability-and-linearizability

It was hard to find information about this subject. However, At some point I found a statement that explained it clearly:

  • Linearizability gives isolation at the level of operations, while Serializability gives isolation at the level of transactions.

As an example:

enter image description here

Here, A, B and C are three different transactions running at the same time. r(varname) means that the current transaction is accessing the value inside varname, and w(varname) means that the current transaction is writing a certain value in varname.

Now, to create a linearized history of these events, we have to make sure that no two operations are happening at the same time. An operation that has started while another operation already started should appear behind the first operation.

In this case:

Log1: A.r(x), B.r(X), B.r(Y), A.w(X), C.r(Y)

To create a Serialized history of these events, one has to separate all the operations of the transactions A, B and C so there are no interleaved operations from other transactions.

From our example this could result in:

Log2: A.r(x), A.w(x), B.r(X), B.r(Y), C.r(Y) 

参考链接:http://en.wikipedia.org/wiki/Serializability




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值