Encyclopedia > Conservative two-phase locking

  Article Content

Conservative two-phase locking

In computer science, conservative two-phase locking (C2PL) is a locking method used in DBMS and relational databases.

Like Non-Strict 2PL, Conservative 2PL prevents deadlocks.

The difference between 2PL and C2PL is that C2PL's transactions obtains all the locks it'll need before it begins. This is to ensure that a transaction that already holds some locks will not block waiting for other locks.

In heavy lock contention, C2PL reduces the time locks are held on average, relative to 2PL and Strict 2PL, because transactions that hold locks are never blocked.

In light lock contention, C2PL holds more locks than is necessary, because it is hard to tell what locks will be needed in the future, thus leads to higher overhead.

Also, a transaction has to release all of its locks, and obtain all of them again, if it fails to obtain even one lock that it needs in the first run. Because of these two reasons, C2PL is not used frequently in professional use.



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Holtsville, New York

... household size is 3.19 and the average family size is 3.47. In the town the population is spread out with 28.2% under the age of 18, 7.5% from 18 to 24, 33.5% from 25 to ...

 
 
 
This page was created in 78.7 ms