Movatterモバイル変換


[0]ホーム

URL:


Uploaded byChethanMp7
PPTX, PDF4,171 views

Lock based protocols

This document discusses lock-based protocols for concurrency control. It describes that locks can be requested in exclusive or shared mode to control concurrent access to data items. A lock compatibility matrix is used to determine if a requested lock is compatible with existing locks held by other transactions. The Two Phase Locking protocol is introduced to ensure conflict serializable schedules by restricting transactions to an growing phase where they only acquire locks and a shrinking phase where they only release locks.

In this document
Powered by AI

Introduction to lock-based protocols managing concurrent data access, including lock types, compatibility, and examples.

Detailed description of the Two Phase Locking (2PL) protocol ensuring serializability through growing and shrinking phases.

Closing remarks on the presented lock-based protocols.

Embed presentation

Download to read offline
LOCK BASED PROTOCOL
LOCK BASED PROTOCOLS A lock is a mechanism to control concurrent access to a data item Data items can be locked in two modes :1. exclusive (X) mode. Data item can be both read as well aswritten. X-lock is requested using lock-X instruction.2. shared (S) mode. Data item can only be read. S-lock isrequested using lock-S instruction. Lock requests are made to the concurrency-control manager by theprogrammer. Transaction can proceed only after request is granted.
LOCK BASED PROTOCOL(CONTD) Lock-compatibility matrix A transaction may be granted a lock on an item if the requested lock is compatiblewith locks already held on the item by other transactions Any number of transactions can hold shared locks on an item, But if any transaction holds an exclusive on the item no other transaction may holdany lock on the item. If a lock cannot be granted, the requesting transaction is made to wait till allincompatible locks held by other transactions have been released. The lock is thengranted.
LOCK BASED PROTOCOL(CONTD) Example of a transaction performing locking:T2: lock-S(A);read (A);unlock(A);lock-S(B);read (B);unlock(B);display(A+B) Locking as above is not sufficient to guarantee serializability — if A and B get updated in-between the read of A and B, the displayed sum would be wrong. A locking protocol is a set of rules followed by all transactions while requesting and releasinglocks. Locking protocols restrict the set of possible schedules.
TWO PHASE LOCKING PROTOCOL This protocol ensures conflict-serializable schedules. Phase 1: Growing Phase Transaction may obtain locks Transaction may not release locks Phase 2: Shrinking Phase Transaction may release locks Transaction may not obtain locks The protocol assures serializability. It can be proved that the transactions canbe serialized in the order of their lock points (i.e., the point where atransaction acquired its final lock).
TWO PHASE LOCKINGPROTOCOL(CONTD) There can be conflict serializable schedules that cannot be obtained if two-phase locking is used. However, in the absence of extra information (e.g., ordering of access todata), two-phase locking is needed for conflict serializability in the followingsense: Given a transaction Ti that does not follow two-phase locking, we can find atransaction Tj that uses two-phase locking, and a schedule for Ti and Tj that is notconflict serializable.
THANK YOU

Recommended

PPTX
2 phase locking protocol DBMS
PPT
16. Concurrency Control in DBMS
PPTX
Concurrency control
PPTX
Concurrency Control in Distributed Database.
PPTX
Concurrency control
PPTX
Deadlock in database
PPTX
Validation based protocol
PPT
Deadlock management
PPTX
Concurrency Control in Database Management System
PPTX
Concurrency control!
PPT
15. Transactions in DBMS
PPT
Joins in SQL
PPTX
Deadlock dbms
PPT
17. Recovery System in DBMS
PPTX
serializability in dbms
PPTX
Tree - Data Structure
PPTX
Timestamp protocols
PPT
Indexing and Hashing
PPTX
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
PPTX
Concurrency control
PPTX
Crash recovery in database
PPTX
Trigger
PPT
13. Query Processing in DBMS
PPTX
database recovery techniques
PDF
management of distributed transactions
PPT
deadlock avoidance
PPTX
Log based and Recovery with concurrent transaction
PPT
concurrency-control
PPTX
Concurrency control PPT

More Related Content

PPTX
2 phase locking protocol DBMS
PPT
16. Concurrency Control in DBMS
PPTX
Concurrency control
PPTX
Concurrency Control in Distributed Database.
PPTX
Concurrency control
PPTX
Deadlock in database
PPTX
Validation based protocol
PPT
Deadlock management
2 phase locking protocol DBMS
16. Concurrency Control in DBMS
Concurrency control
Concurrency Control in Distributed Database.
Concurrency control
Deadlock in database
Validation based protocol
Deadlock management

What's hot

PPTX
Concurrency Control in Database Management System
PPTX
Concurrency control!
PPT
15. Transactions in DBMS
PPT
Joins in SQL
PPTX
Deadlock dbms
PPT
17. Recovery System in DBMS
PPTX
serializability in dbms
PPTX
Tree - Data Structure
PPTX
Timestamp protocols
PPT
Indexing and Hashing
PPTX
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
PPTX
Concurrency control
PPTX
Crash recovery in database
PPTX
Trigger
PPT
13. Query Processing in DBMS
PPTX
database recovery techniques
PDF
management of distributed transactions
PPT
deadlock avoidance
PPTX
Log based and Recovery with concurrent transaction
Concurrency Control in Database Management System
Concurrency control!
15. Transactions in DBMS
Joins in SQL
Deadlock dbms
17. Recovery System in DBMS
serializability in dbms
Tree - Data Structure
Timestamp protocols
Indexing and Hashing
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
Concurrency control
Crash recovery in database
Trigger
13. Query Processing in DBMS
database recovery techniques
management of distributed transactions
deadlock avoidance
Log based and Recovery with concurrent transaction

Similar to Lock based protocols

PPT
concurrency-control
PPTX
Concurrency control PPT
DOCX
Concurrency Control Techniques
PPTX
Concurrency control
PPTX
Unit 4 Concurrency control.pptx dbms lovely
PPTX
recoverability and serializability dbms
PPTX
Characteristics Schedule based on Recover-ability & Serial-ability
DOCX
Locking base concurrency control
PPTX
Concurrency Management
PPTX
PPTX
Concurrency Control in Databases.Database management systems
PPTX
BCT 2312 - Chapter 3 - Concurrency Control Techniques in DBMSs.pptx
PDF
Concurrency Control in Database Management System
PPTX
CHapter four database managementm04.pptx
PDF
Module 5 part-2 concurrency control in dbms
PDF
concurrencycontrol from power pint pdf a
PDF
Cs501 concurrency
PPTX
Concurrency Control.pptx
PPTX
2 con control
PPT
Concurrency control
concurrency-control
Concurrency control PPT
Concurrency Control Techniques
Concurrency control
Unit 4 Concurrency control.pptx dbms lovely
recoverability and serializability dbms
Characteristics Schedule based on Recover-ability & Serial-ability
Locking base concurrency control
Concurrency Management
Concurrency Control in Databases.Database management systems
BCT 2312 - Chapter 3 - Concurrency Control Techniques in DBMSs.pptx
Concurrency Control in Database Management System
CHapter four database managementm04.pptx
Module 5 part-2 concurrency control in dbms
concurrencycontrol from power pint pdf a
Cs501 concurrency
Concurrency Control.pptx
2 con control
Concurrency control

Recently uploaded

PPTX
TRANSPORTATION ENGINEERING Unit-5.1.pptx
PPTX
Blockchain and cryptography Lecture Notes
PPTX
DevFest Seattle 2025 - AI Native Design Patterns.pptx
PPTX
unit-1 Data structure (3).pptx Data structure And Algorithms
PPTX
neural-networks-intro-basic-engineering.pptx
PDF
@Regenerative braking system of DC motor
PPTX
State Space Model of DC-DC Boost Converter
PDF
The Impact of Telework on Urban Development (www.kiu.ac.ug)
PDF
Introduction to MySQL Spatial Features and Real-World Use Cases
PDF
Chemical Bonding _ Class Notes.pdf for jee
PPTX
Mc25104 - data structures and algorithms using PYTHON OOP_Python_Lecture_Note...
PDF
Small Space Big Design - Amar DeXign Scape
PPT
Chapter 1-Week 4-General Thermodynamics-Introduction.ppt
PDF
Advancements in Telecommunication for Disaster Management (www.kiu.ac.ug)
PDF
HEV Descriptive Questions https://www.slideshare.net/slideshow/hybrid-electr...
PPTX
Washing-Machine-Simulation-using-PICSimLab.pptx
PDF
Soil Permeability and Seepage-Irrigation Structures
PDF
IPE 105 - Engineering Materials Constitution of Alloys
PPTX
2-Photoelectric effect, phenomena and its related concept.pptx
PPTX
Presentation 1.pptx WHAT IS ARTIFICIAL INTELLIGENCE?
TRANSPORTATION ENGINEERING Unit-5.1.pptx
Blockchain and cryptography Lecture Notes
DevFest Seattle 2025 - AI Native Design Patterns.pptx
unit-1 Data structure (3).pptx Data structure And Algorithms
neural-networks-intro-basic-engineering.pptx
@Regenerative braking system of DC motor
State Space Model of DC-DC Boost Converter
The Impact of Telework on Urban Development (www.kiu.ac.ug)
Introduction to MySQL Spatial Features and Real-World Use Cases
Chemical Bonding _ Class Notes.pdf for jee
Mc25104 - data structures and algorithms using PYTHON OOP_Python_Lecture_Note...
Small Space Big Design - Amar DeXign Scape
Chapter 1-Week 4-General Thermodynamics-Introduction.ppt
Advancements in Telecommunication for Disaster Management (www.kiu.ac.ug)
HEV Descriptive Questions https://www.slideshare.net/slideshow/hybrid-electr...
Washing-Machine-Simulation-using-PICSimLab.pptx
Soil Permeability and Seepage-Irrigation Structures
IPE 105 - Engineering Materials Constitution of Alloys
2-Photoelectric effect, phenomena and its related concept.pptx
Presentation 1.pptx WHAT IS ARTIFICIAL INTELLIGENCE?

Lock based protocols

  • 1.
  • 2.
    LOCK BASED PROTOCOLSA lock is a mechanism to control concurrent access to a data item Data items can be locked in two modes :1. exclusive (X) mode. Data item can be both read as well aswritten. X-lock is requested using lock-X instruction.2. shared (S) mode. Data item can only be read. S-lock isrequested using lock-S instruction. Lock requests are made to the concurrency-control manager by theprogrammer. Transaction can proceed only after request is granted.
  • 3.
    LOCK BASED PROTOCOL(CONTD)Lock-compatibility matrix A transaction may be granted a lock on an item if the requested lock is compatiblewith locks already held on the item by other transactions Any number of transactions can hold shared locks on an item, But if any transaction holds an exclusive on the item no other transaction may holdany lock on the item. If a lock cannot be granted, the requesting transaction is made to wait till allincompatible locks held by other transactions have been released. The lock is thengranted.
  • 4.
    LOCK BASED PROTOCOL(CONTD)Example of a transaction performing locking:T2: lock-S(A);read (A);unlock(A);lock-S(B);read (B);unlock(B);display(A+B) Locking as above is not sufficient to guarantee serializability — if A and B get updated in-between the read of A and B, the displayed sum would be wrong. A locking protocol is a set of rules followed by all transactions while requesting and releasinglocks. Locking protocols restrict the set of possible schedules.
  • 5.
    TWO PHASE LOCKINGPROTOCOL This protocol ensures conflict-serializable schedules. Phase 1: Growing Phase Transaction may obtain locks Transaction may not release locks Phase 2: Shrinking Phase Transaction may release locks Transaction may not obtain locks The protocol assures serializability. It can be proved that the transactions canbe serialized in the order of their lock points (i.e., the point where atransaction acquired its final lock).
  • 6.
    TWO PHASE LOCKINGPROTOCOL(CONTD)There can be conflict serializable schedules that cannot be obtained if two-phase locking is used. However, in the absence of extra information (e.g., ordering of access todata), two-phase locking is needed for conflict serializability in the followingsense: Given a transaction Ti that does not follow two-phase locking, we can find atransaction Tj that uses two-phase locking, and a schedule for Ti and Tj that is notconflict serializable.
  • 7.

[8]ページ先頭

©2009-2025 Movatter.jp