Two Phase Locking High Priority (2PL-HP) Protocol, 2PL-HP Concurrency Control Protocol for real-time database
2PL High-Priority (2PL-HP)
It is one of the pessimistic
concurrency control protocols. It modifies the basic 2PL protocol by incorporating
high priority conflict resolution scheme. It works as follows;
When a higher priority transaction
(requester) is requesting a lock on an object held by lower priority
transactions (lock holder) in a conflicting mode, the lock holders are aborted
or restarted and the requester is granted the lock.
If the requester’s priority is lower
than the lock holders’ priority then requester will wait for the object to be
released.
A new reader can join the group of
lock-holding readers only if its priority is higher than that of all the
writers waiting for the lock.
This can be represented in pseudo code
as follows;
/* P(T) denotes the priority of a
transaction T.
Tr is the requesting
transaction with HIGHER PRIORITY.
Th is the lock holding
transaction with LOWER PRIORITY. */
if
(P(Tr)>P(Th)) then
Th ABORTs;
Tr
continues;
else
Tr WAIT;
endif
Discussion:
Let us assume a transaction T1 with
higher priority is requesting a data item held by a transaction T2 with lower
priority. The 2PL-HP forces (wound) the lower priority transaction T2 to
restart or abort. This action will release the lock held by T2, then T1
acquires the lock and continue.
If T1’s priority is lower than that of
T2’s priority, then 2PL-HP forces T1 to wait for the object to be released by
T2.
2PL-HP shows the properties of “priority
based wound-wait” under conflict resolution.
Merits:
- 2PL-HP serves a deadlock prevention mechanism.
- 2PL-HP ensures urgent higher priority transactions to meet their deadlines.
Demerits:
- A transaction restarted by a higher-priority transaction may miss its deadline and discarded.
- Lower priority transactions always restarted due to the higher priority transactions end in wastage of system resources used by lower priority transactions.
- More number of lower priority transactions with conflicting locks will lead to wasted restarts thus results in performance degradation of the system.
Comparison:
The experimental results showed
real-time concurrency control algorithms based on High-Priority perform
considerably better than those based on Priority-Inheritance. Furthermore, it was found that the 2PL-HP outperforms
the 2PL-WP scheme in the context of a RTDB environment, and it was concluded that
the basic priority-inheritance is inappropriate for conflict resolution under
2PL.
References:
Abbott, R., and
Garcia-Molina, H. 1988. Scheduling real-time transactions: a performance
evaluation, Proc. of 14th Intl. Conf. on Very Large DataBases. August
**************************
Go back to real-time database pessimistic protocols page
Go back to concurrency control in real-time database page
Go to REAL TIME DATABASE Home page
No comments:
Post a Comment