Professional Documents
Culture Documents
Presented By: Shweta Kushwaha (2k08it077) Smriti Srivastava (2k08it078)
Presented By: Shweta Kushwaha (2k08it077) Smriti Srivastava (2k08it078)
Shweta Kushwaha(2k08it077)
Smriti Srivastava(2k08it078)
Topics which we are covered in our
presentation::
Where N=available
seats
• Binary locks
• Shared/exclusive locks
Binary Locks
• Binary lock can have two states :
• locked and unlocked (or 1 and 0, for
simplicity).
• A distinct lock is associated with each
database item X.
• If the value of the lock on X is 1, item X
cannot be accessed by a database operation
that requests the item.
• If the value of the lock on X is 0, the item
can be accessed when requested.
• We refer to the current value (or state) of
the lock associated with item X as LOCK(X).
8
Shared/Exclusive (or
Read/Write) Locks
• shared/exclusive or read/write
locks—there are three locking
operations:
– read_lock(X),
– write_lock(X), and
– unlock(X).
9
Locks
10
Two-phase locking
( 2PL)
• A two-phase locking ( 2PL) scheme is a
locking scheme in which a transaction
cannot request a new lock after
releasing a lock. It has two phases:
– Growing Phase ( Locking Phase) - When
locks are acquired and none released.
– Shrinking Phase ( Unlocking Phase) - When
locks are released and none acquired.
Timestamping
• Timestamping:
– …is a concurrency control protocol.
– …ensures that transactions with smaller
(older) timestamps, get priority in the
event of conflict.
Optimistic concurrency control