ch16 - Chapter16:ConcurrencyControl n n

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 16: Concurrency Control n Goal: ensure concurrent execution of transactions  only generates correct results n Concurrency control using Lock-Based Protocols n Types of locks n Two-Phase Locking Protocol: ensures serializability n Deadlock Handling
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Exclusive Lock n A lock is a mechanism to control concurrent access to a  data item n Data items can be locked in two modes : n Exclusive  (X) mode n It allows a transaction to read/write the item n It is exclusive such that only one transaction can owns the lock n X-lock is requested using  lock-X  instruction n Real life example: n ATM machine: only one person can use it at a time, others need  to wait
Background image of page 2
Shared Lock n Shared  (S) mode n S-lock allows a transaction to read an item n Multiple transactions may have S-lock on the  same data item n S-lock is requested using   lock-S  instruction n Real life example n Our classroom  n Multiple people can get in at the same time
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lock Manager n There is a lock manager that manages lock n Transactions will send lock requests to the lock manager n The lock manager keeps track of all locks currently  granted  n The lock manager will approve a lock request if there is  no conflict n A transaction can continue if its request get approved n Otherwise it has to wait for its approval (typically it will  sleep until approval)
Background image of page 4
Lock-Based Protocols n A transaction releases a lock after  completion of the operation on the  locked item n These lock requests and releases are  inserted automatically by the system n When can a transaction get a S-lock or  X-lock?
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lock-Based Protocols (Cont.) n
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/28/2012 for the course IS 620 taught by Professor Chen,z during the Spring '08 term at UMBC.

Page1 / 22

ch16 - Chapter16:ConcurrencyControl n n

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online