Difference between Linearizability and Serializability
2013-11-14 17:47
423 查看
原文: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:
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:
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:
参考链接:http://en.wikipedia.org/wiki/Serializability
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:
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
相关文章推荐
- Difference between Linearizability and Serializability
- Difference between STA and MTA in thread
- Difference Between XML and XAML
- Preparing for Application and Service Deployment-Differences Between the Storage Emulator and Window
- what difference between Restrictions and Property in hibernate ?who can tell me?
- The difference between CLOCK_MONOTONIC and CLOCK_REALTIME
- The difference between null and DBNull.Value
- Difference between Stack and Heap memory in Java
- JMS: The difference between Message Acknowledgement and Transacted Session
- What is the difference between objectForKey and valueForKey?
- What is the difference between a von Neumann architecture and a Harvard architecture?
- What is the difference between Terminal, Console, Shell, and Command Line?
- difference between Cookie and Session
- The differences between Carriage Return(CR) and Line Feed(LF)
- Part 37 Difference between $scope and $rootScope
- The difference between VNLS_PARAMETERS and NLS_DATABASE_PARAMETERS
- What is the difference between "green" threads and "native" threads?
- SSL和SSH的不同(the differences between SSH and ssl)
- difference between stack and heap
- the difference between threads and processes