Download presentation
Presentation is loading. Please wait.
1
Presentation Topic 18.7 of Book Tree Protocol Submitted to: Prof. Dr. T.Y.LIN Submitted By :Saurabh Vishal
2
Topic’s That Should be covered in This Presentation Motivation for Tree-Based Locking Rules for Access to Tree-Structured Data Why the Tree Protocol Works
3
BASICS B-Trees - Tree data structure that keeps data sorted - allow searches, insertion, and deletion - commonly used in database and file systems Lock - Enforce limits on access to resources - way of enforcing concurrency control Lock Granularity - Level and type of information that lock protects.
4
Introduction Tree structures that are formed by the link pattern of the elements themselves. Database are the disjoint pieces of data, but the only way to get to Node is through its parent. B trees are best example for this sort of data. Knowing that we must traverse a particular path to an element give us some important freedom to manage locks differently from two phase locking approaches.
5
Tree Based Locking B tree index in a system that treats individual nodes( i.e. blocks) as lockable database elements. The Node Is the right level granularity. We use a standard set of locks modes like shared,exculsive, and update locks and we use two phase locking
6
Rules for access Tree Structured Data There are few restrictions in locks from the tree protocol. We assume that that there are only one kind of lock. Transaction is consider a legal and schedules as simple. Expected restrictions by granting locks only when they do not conflict with locks already at a node, but there is no two phase locking requirement on transactions.
7
Why the tree protocol works. A transaction's first lock may be at any node of the tree. Subsequent locks may only be acquired if the transaction currently has a lock on the parent node. Nodes may be unlocked at any time A transaction may not relock a node on which it has released a lock, even if it still holds a lock on the node’s parent
8
A tree structure of Lockable elements
9
Three transactions following the tree protocol
10
Why the Tree Protocol works? The Tree protocol forces a serial order on the transactions involved in a schedule. Ti <sTj if in schedule S., the transaction Ti and Tj lock a node in common and Ti locks the node first.
11
Example If precedence graph drawn from the precedence relations that we defined above has no cycles, then we claim that any topological order of transactions is an equivalent serial schedule. For Example either ( T1,T2,T3) or (T3,T1,T2) is an equivalent serial schedule the reason for this serial order is that all the nodes are touched in the same order as they are originally scheduled.
12
If two transactions lock several elements in common, then they are all locked in same order. I am Going to explain this with help of an example.
13
Precedence graph derived from Schedule
14
Example:--4 Path of elements locked by two transactions
15
Now Consider an arbitrary set of transactions T1, T2;.... Tn,, that obey the tree protocol and lock some of the nodes of a tree according to schedule S. First among those that lock, the root. they do also in same order. If Ti locks the root before Tj, Then Ti locks every node in common with Tj does. That is Ti sTi. Continued….
16
ADVANTAGES OF TREE PROTOCOL Unlocking takes less time as compared to 2PL Freedom from deadlocks
17
Any Questions? Thank You for Your Attention
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.