scispace - formally typeset
Search or ask a question
Journal ArticleDOI

A real-time locking protocol

01 Jul 1991-IEEE Transactions on Computers (IEEE Computer Society)-Vol. 40, Iss: 7, pp 793-800
TL;DR: It is shown that this protocol leads to freedom from mutual deadlock and can be used by schedulability analysis to guarantee that a set of periodic transactions using this protocol can always meet its deadlines.
Abstract: The authors examine a priority driven two-phase lock protocol called the read/write priority ceiling protocol. It is shown that this protocol leads to freedom from mutual deadlock. In addition, a high-priority transactions can be blocked by lower priority transactions for at most the duration of a single embedded transaction. These properties can be used by schedulability analysis to guarantee that a set of periodic transactions using this protocol can always meet its deadlines. Finally, the performance of this protocol is examined for randomly arriving transactions using simulation studies. >

Summary (2 min read)

1. Introduction

  • In a real-time database context, concurrency control protocols must not only maintain the consistency constraints of the database but also satisfy the timing requirements of the transactions accessing the database.
  • Next, the authors process transactions in priority order.
  • The preemption of T3, and hence the blocking of T1, will continue until T2 and any other pending intermediate-priority level transactions are completed.
  • An objective of this paper is to design an appropriate priority management protocol for a given concurrency control protocol so that deadlocks can be avoided and the duration of blocking can be tightly bounded.

2.1. Basic Concepts

  • Real-time databases are often used by applications such as tracking.
  • The authors assume that an embedded transaction consists of a sequence of read and write operations operating upon the database.
  • Task τ0 will therefore continue and execute its transaction, thereby effectively preempting T2 in its transaction and not encountering any blocking.

2.2. Definitions and Properties

  • Having reviewed the basic concepts, the authors now review their assumptions and state the notation used.
  • The authors also assume that a transaction does not attempt to lock an object that it has already locked and thus deadlock with itself.
  • Under the read- or write-priority ceiling protocol, mutual deadlock of transactions cannot occur and each task can be blocked by at most one embedded transaction until it completes or suspends itself.
  • The authors now develop a set of sufficient conditions under which a set of periodic tasks with hard deadlines at the end of the periods can be scheduled by the rate-monotonic algorithm [15] when the read- or write-priority ceiling protocol is used.

3. Performance Evaluation

  • In the previous section, the authors have assumed that all the tasks are periodic and that all the database objects are in the main memory.
  • For each experiment and for each algorithm tested, the authors collected performance statistics and averaged over 10 runs.
  • The two important factors affecting the performance of locking protocols are their abilities to resolve the locking conflicts and to perform the I/O and transactions in parallel.
  • The main weakness of the read- or write-priority ceiling protocol is its inability to perform I/O and transactions in parallel.
  • In their experiments, each transaction’s deadline is set proportional to its size and system workload (number of transactions), and the transaction with the shorter deadline is assigned a higher priority.

4. Conclusions

  • Real-time database is an important area of research, with applications ranging from surveillance to reliable manufacturing and production control.
  • The authors have investigated the read- or write-priority ceiling protocol, which integrates the two-phase lock protocol with priority-driven real-time scheduling.
  • The authors have also developed schedulability bounds for periodic tasks in a centralized in-core database.
  • Finally, the authors experimentally evaluated the performance of this protocol when the tasks are invoked aperiodically and the database is no longer in-core.

Did you find this useful? Give us your feedback

Content maybe subject to copyright    Report

Technical Report
CMU/SEI-89-TR-018
ESD-89-TR-026
A Real-Time Locking Protocol
Lui Sha
Ragunathan Rajkumar
Sang Son
Chun-Hyon Chang
April 1989

A Real-Time Locking Protocol
AB
Software Engineering Institute
Carnegie Mellon University
Pittsburgh, Pennsylvania 15213
Technical Report
CMU/SEI-89-TR-018
ESD-89-TR-026
April 1989
Lui Sha
Real-Time Scheduling in Ada Project
Ragunathan Rajkumar
Carnegie Mellon University
Sang Son
University of Virginia
Chun-Hyon Chang
Kon Kuk University, Seoul, Korea
Unlimited distribution subject to the copyright.

This report was prepared for the SEI Joint Program Office HQ ESC/AXS
5 Eglin Street
Hanscom AFB, MA 01731-2116
The ideas and findings in this report should not be construed as an official DoD position. It is
published in the interest of scientific and technical information exchange.
FOR THE COMMANDER
(signature on file)
Thomas R. Miller, Lt Col, USAF, SEI Joint Program Office
This work is sponsored by the U.S. Department of Defense.
Copyright 1989 by Carnegie Mellon University.
Permission to reproduce this document and to prepare derivative works from this document for internal use is granted, provided the copyright and
\‘No Warranty\’ statements are included with all reproductions and derivative works. Requests for permission to reproduce this document or to
prepare derivative works of this document for external and commercial use should be addressed to the SEI Licensing Agent.
NO WARRANTY
THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN \‘AS-IS\’ BASIS.
CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER
INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTIBILITY, EXCLUSIVITY, OR RESULTS
OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH
RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT.
This work was created in the performance of Federal Government Contract Number F19628-95-C-0003 with Carnegie Mellon University for the
operation of the Software Engineering Institute, a federally funded research and development center. The Government of the United States has a
royalty-free government-purpose license to use, duplicate, or disclose the work, in whole or in part and in any manner, and to have or permit
others to do so, for government purposes pursuant to the copyright license under the clause at 52.227-7013.
This document is available through Asset Source for Software Engineering Technology (ASSET) / 1350 Earl L. Core Road ; P.O. Box 3305 /
Morgantown, West Virginia 26505 / Phone: (304) 284-9000 / Fax: (304) 284-9001 / e-mail: sei@asset.com / WWW:
http://www.asset.com/sei.html
Copies of this document are available through the National Technical Information Service (NTIS). For information on ordering, please contact
NTIS directly: National Technical Information Service / U.S. Department of Commerce / Springfield, VA 22161. Phone: (703) 487-4600.
This document is also available through the Defense Technical Information Center (DTIC). DTIC provides acess to and transfer of scientific and
technical information for DoD personnel, DoD contractors and potential con tractors, and other U.S. Government agency personnel and their
contractors. To obtain a copy, please contact DTIC directly: Defense Technical Information Center / 8725 John J. Kingman Road / Suite 0944 /
Ft. Belvoir, VA 22060-6218. Phone: 1-800-225-3842 or 703-767-8222.

1
Use of any trademarks in this report is not intended in any way to infringe on the rights of the trademark holder.

CMU/SEI-89-TR-18 1
A Real-Time
Locking Protocol
Abstract: When a database system is used in a real-time application, the concur-
rency control protocol must satisfy not only the consistency of shared data but
also the timing constraints of the application. In this paper, we examine a priority-
driven two-phase lock protocol called the read- or write-priority ceiling protocol.
We show that this protocol is free of deadlock, and in addition a high-priority trans-
action can be blocked by lower priority transactions for at most the duration of a
single embedded transaction. We then evaluate system performance experimen-
tally.
1. Introduction
In a real-time database context, concurrency control protocols must not only maintain the
consistency constraints of the database but also satisfy the timing requirements of the trans-
actions accessing the database.
Both concurrency control [2, 3, 4, 5, 7, 16, 17, 18, 20, 21, 23, 26] and real-time scheduling
algorithms [10, 11, 13, 14, 15, 19, 22, 27] are active areas of research in their own right. It
may seem that the development of a real-time locking protocol is a simple matter of combin-
ing priority scheduling with a locking protocol. For example, we may require each trans-
action to use a well-known concurrency protocol such as the two-phase lock protocol [6] and
assign priorities to transactions according to some well-known scheduling algorithms such
as the earliest deadline algorithm [19]. Next, we process transactions in priority order. Un-
fortunately, such an approach may lead to unbounded priority inversion, in which a high-
priority task would wait for lower priority tasks for an indefinite period of time.
Example 1: Suppose T
1
, T
2
, and T
3
are three transactions arranged in descending order of
priority, with T
1
having the highest priority. Assume that transaction T
1
and T
3
share the
same data object O. Suppose that at time
t
1
transaction T
3
obtains a write-lock on O.
During the execution of T
3
, the high-priority task T
1
arrives and attempts to read-lock the
object O. Transaction T
1
will be blocked, since O is already write-locked. We would expect
that T
1
, being the highest priority transaction, will be blocked no longer than the time for T
3
to complete and unlock O. However, the duration of blocking may, in fact, be unbounded.
This is because transaction T
3
can be preempted by the intermediate-priority transaction T
2
that does not need to access O. The preemption of T
3
, and hence the blocking of T
1
, will
continue until T
2
and any other pending intermediate-priority level transactions are com-
pleted.
The blocking duration in Example 1 can be arbitrarily long. This situation can be partially
remedied if transactions are not allowed to be preempted; however, this solution is only ap-
propriate for very short transactions, because it creates unnecessary blocking. For instance,

Citations
More filters
Journal ArticleDOI
TL;DR: It is concluded that priority cognizance does not appear to be a promising technique to increase real-time CC performance as it turns out that it is very difficult for priority cognize to work as the above mentioned condition does not, usually, hold.
Abstract: After a "boom" period from the late 80s to the early 90s, there appears to have been a reduction in the amount of work published on Concurrency Control (CC) in real-time database systems (RTDBS) in general and firm RTDBS in particular. This may be because existing paradigms (e.g., Optimistic CC) have been pushed to their limits and it is difficult to extract additional meaningful performance. One of the last unresolved bastions of real-time CC is the successful incorporation of priority cognizance. Researchers have speculated that priority cognizant optimistic concurrency control (OCC) algorithms, if designed well, could outperform priority insensitive ones in real-time database systems. So far, however, there is a distinct lack of conclusive proof available on this topic and the priority cognizant OCC algorithms that have appeared so far in the literature cannot claim unilateral superiority over their priority insensitive relatives. We thus surmise that successful incorporation of priority cognizance may lead to an increase in the performance of OCC protocols in firm RTDBSs. Based on this premise, we analyze the issue of priority cognizance and identify a critical condition that must hold for priority cognizant conflict resolution to work. The condition is that, on the average, the conflict sets of validating transactions should have a "large" number of transactions: We call this a bird in hand more than two in the bush phenomenon. Subsequently, we design a smart priority cognizant OCC variant, which we call OCC-APR, and analyze its performance, as well as that of several other concurrency control algorithms across a wide range of resource contention and system loading parameters. Surprisingly, it turns out that it is very difficult for priority cognizance to work as the above mentioned condition does not, usually,hold. We explain why this occurs and conclude that priority cognizance does not appear to be a promising technique to increase real-time CC performance. The contribution of this paper, thus, is to have laid to rest the "priority cognizance" issue with regard to real-time CCMs.

18 citations

01 Jan 2005
TL;DR: This thesis provides the theoretical support to compute the maximal size of the reserved bandwidth after guaranteeing schedulability of a periodic task set for earliest deadline first (EDF), rate monotonic (RMA), and FPPT algorithms.
Abstract: This thesis focuses on two real-time scheduling algorithms: fixed-priority with preemption threshold (FPPT) and the reservation-based algorithm (RBA). FPPT is an important form of real-time scheduling algorithm that generalizes both fixed-priority preemptive (FPP) and fixed-priority non-preemptive (FPNP), i.e., FPP and FPNP are the two boundary cases for FPPT. The critical instant for FPPT is rephrased, and it is shown that FPPT is robust under its critical instant. When a task set is schedulable by FPPT with predefined regular priorities, there may exist multiple valid preemption threshold assignments, which are proved to be delimited by two special assignments, called minimal and maximal assignment respectively. This thesis presents effective algorithms to compute the minimal and maximal assignment by starting from FPNP In addition, algorithms are presented to compute the minimal (maximal) assignment when the other is known. The maximal assignment reduces the number of context switches and can eliminate some resource sharing issues. It is shown that the algorithm to find the maximal assignment can be used to perform a schedulability test for FPPT. Resource management protocols for FPPT are not addressed in this work, which is left for future study. RBA is a kind of bandwidth reservation algorithm in which an even duration of time (the bandwidth) is made available for executing aperiodic tasks to improve their response time. This thesis provides the theoretical support to compute the maximal size of the reserved bandwidth after guaranteeing schedulability of a periodic task set for earliest deadline first (EDF), rate monotonic (RMA), and FPPT algorithms. When RMA is used to schedule periodic tasks, the known algorithm to calculate the reservation size is complicated and ineffective. It is shown that the combination of RBA and FPPT can obtain a reservation size no smaller than that of RMA and avoid the high run-time cost of EDF. Combined with a background server, the response time of aperiodic tasks can be further improved. However, this thesis does not consider all practical issues. For example, the bandwidth may be too small and the practical costs of additional context switching may be expensive. To verify the research results of this thesis, a small real-time scheduling tool-kit was created as part of the thesis work. The tool-kit allows scheduling algorithms to be created and tested (via simulations), where scheduling results are presented as step-by-step Gantt-charts. The tool-kit was invaluable in generating examples to prove or disprove different aspects of the scheduling work for the thesis. The tool-kit has been extended with multiple scheduling algorithms, not just those specific to this thesis.

17 citations


Cites background from "A real-time locking protocol"

  • ...Many real-time scheduling algorithms have been created for different applications from static to dynamic [45, 57] from uniprocessor to multiprocessor [5, 6], from serial to parallel algorithms [44, 35, 24, 54], using both weak and strong assumptions [61, 61, 58, 11]....

    [...]

  • ...To solve the problem, specific resource management protocols have been proposed [27, 61, 62, 65]....

    [...]

DissertationDOI
01 Sep 1995
TL;DR: An integrated transaction processing scheme that extends a priority-based task scheduling framework for mixed task sets into a transaction processing environment, combining it with best-e ort real-time transaction scheduling algorithms, and introduces a temporal consistency enforcement scheme called Static Temporal Consistency Enforcement (STCE).
Abstract: A real-time database system (RTDBS) can be de ned as a database system where transactions are associated with real-time constraints typically in the form of deadlines. The system must process transactions so as to both meet the deadlines and maintain the data consistency. Previous research e ort in this eld has been focused on scheduling transactions with soft or rm deadlines under the conventional transaction model and database system architecture which cannot support predictable real-time transaction processing. In this thesis, we provide a framework to realize predictable real-time transaction processing, satisfying both timing and consistency constraints of a real-time database system. First, we classify data objects and transactions found in typical real-time database applications, considering their distinct characteristics and requirements. Each type of real-time data objects has its own correctness criteria, di erent from the conventional one. Real-time transactions are categorized, according to their timing constraints, arrival patterns, data access patterns, availability of data and run-time requirements, and accessed data type. Our model is a superset of conventional models; it includes both hard and soft real-time transactions, and supports the temporal consistency as well as the logical consistency of the database. Second, we develop an integrated transaction processing scheme that extends a xedpriority-based task scheduling framework for mixed task sets into a transaction processing environment, combining it with best-e ort real-time transaction scheduling algorithms. This scheme provides predictability for a RTDBS in the sense that under our transaction processing scheme it is guaranteed that every application in the system will achieve its own performance goals. Along with the transaction processing scheme, a temporal consistency enforcement scheme called Static Temporal Consistency Enforcement (STCE) is introduced.

17 citations


Cites background from "A real-time locking protocol"

  • ..., fClass Ig [61, 4, 66] or fClass IIIg [1, 25, 28, 64]), and never discriminate among transactions in the system....

    [...]

  • ...Sha et al proposed algorithms for scheduling a xed set of periodic transactions with hard deadlines [59, 61]....

    [...]

Journal ArticleDOI
TL;DR: Traditional processor demand analysis is extended to let arbitrary deadline real-time tasks share non-preemptable resources and suffer release jitter and is incorporated into QPA (Quick Processor-demand Analysis) which provides an efficient implementation of the exact test.
Abstract: Earliest Deadline First (EDF) is the most widely studied optimal dynamic scheduling algorithm for uniprocessor real-time systems. In the existing literature, however, there is no complete exact analysis for EDF scheduling when both resource sharing and release jitter are considered. Since resource sharing and release jitter are important characteristics of embedded real-time systems, a solid theoretical foundation should be provided for EDF scheduled systems. In this paper, we extend traditional processor demand analysis to let arbitrary deadline real-time tasks share non-preemptable resources and suffer release jitter. A complete and exact schedulability analysis for EDF scheduled systems is provided. This analysis is incorporated into QPA (Quick Processor-demand Analysis) which provides an efficient implementation of the exact test.

16 citations


Cites background from "A real-time locking protocol"

  • ...If a high­priority task is suspended waiting for a lower-priority task to complete its use of a non-preemptable resource, then priority inversion occurs [Sha et al. 1991]....

    [...]

Book ChapterDOI
01 Jan 1991
TL;DR: This paper addresses some of the issues associated with scheduling and concurrency control for real-time database systems, and presents an optimistic algorithm for priority-based locking.
Abstract: The design and implementation of real-time database systems presents many new and challenging problems. Compared with traditional databases, real-time database systems have a distinct feature: they must satisfy timing constraints associated with transactions. Transactions in real-time database systems should be scheduled considering both data consistency and timing constraints. In addition, a real-time database system must adapt to changes in the operating environment and guarantee the completion of critical transactions. In this paper, we address some of the issues associated with scheduling and concurrency control for real-time database systems, and present an optimistic algorithm for priority-based locking.

15 citations

References
More filters
Book
03 Jan 1989
TL;DR: In this paper, the problem of multiprogram scheduling on a single processor is studied from the viewpoint of the characteristics peculiar to the program functions that need guaranteed service, and it is shown that an optimum fixed priority scheduler possesses an upper bound to processor utilization which may be as low as 70 percent for large task sets.
Abstract: The problem of multiprogram scheduling on a single processor is studied from the viewpoint of the characteristics peculiar to the program functions that need guaranteed service. It is shown that an optimum fixed priority scheduler possesses an upper bound to processor utilization which may be as low as 70 percent for large task sets. It is also shown that full processor utilization can be achieved by dynamically assigning priorities on the basis of their current deadlines. A combination of these two scheduling techniques is also discussed.

5,397 citations

Book
01 Feb 1987
TL;DR: In this article, the design and implementation of concurrency control and recovery mechanisms for transaction management in centralized and distributed database systems is described. But this can lead to interference between queries and updates.
Abstract: This book is an introduction to the design and implementation of concurrency control and recovery mechanisms for transaction management in centralized and distributed database systems. Concurrency control and recovery have become increasingly important as businesses rely more and more heavily on their on-line data processing activities. For high performance, the system must maximize concurrency by multiprogramming transactions. But this can lead to interference between queries and updates, which concurrency control mechanisms must avoid. In addition, a satisfactory recovery system is necessary to ensure that inevitable transaction and database system failures do not corrupt the database.

3,891 citations

Journal ArticleDOI
TL;DR: An investigation is conducted of two protocols belonging to the priority inheritance protocols class; the two are called the basic priority inheritance protocol and the priority ceiling protocol, both of which solve the uncontrolled priority inversion problem.
Abstract: An investigation is conducted of two protocols belonging to the priority inheritance protocols class; the two are called the basic priority inheritance protocol and the priority ceiling protocol. Both protocols solve the uncontrolled priority inversion problem. The priority ceiling protocol solves this uncontrolled priority inversion problem particularly well; it reduces the worst-case task-blocking time to at most the duration of execution of a single critical section of a lower-priority task. This protocol also prevents the formation of deadlocks. Sufficient conditions under which a set of periodic tasks using this protocol may be scheduled is derived. >

2,443 citations


"A real-time locking protocol" refers background in this paper

  • ...With only two-phase locking and priority assignment, we can encounter the problem of unbounded priority inversion as illustrated in Example 1. However, the idea of priority inheritance [ 24 ] solves the unbounded priority inversion problem....

    [...]

Journal ArticleDOI
TL;DR: It is argued that a transaction needs to lock a logical rather than a physical subset of the database, and an implementation of predicate locks which satisfies the consistency condition is suggested.
Abstract: In database systems, users access shared data under the assumption that the data satisfies certain consistency constraints. This paper defines the concepts of transaction, consistency and schedule and shows that consistency requires that a transaction cannot request new locks after releasing a lock. Then it is argued that a transaction needs to lock a logical rather than a physical subset of the database. These subsets may be specified by predicates. An implementation of predicate locks which satisfies the consistency condition is suggested.

2,031 citations


"A real-time locking protocol" refers methods in this paper

  • ...Each embedded transaction will follow the two-phase lock protocol [ 6 ], which requires a transaction to acquire all the locks before it releases any lock....

    [...]

  • ...For example, we may require each transaction to use a well-known concurrency protocol such as the two-phase lock protocol [ 6 ] and assign priorities to transactions according to some well-known scheduling algorithms such as the earliest deadline algorithm [19]....

    [...]

Proceedings ArticleDOI
05 Dec 1989
TL;DR: An exact characterization of the ability of the rate monotonic scheduling algorithm to meet the deadlines of a periodic task set and a stochastic analysis which gives the probability distribution of the breakdown utilization of randomly generated task sets are represented.
Abstract: An exact characterization of the ability of the rate monotonic scheduling algorithm to meet the deadlines of a periodic task set is represented. In addition, a stochastic analysis which gives the probability distribution of the breakdown utilization of randomly generated task sets is presented. It is shown that as the task set size increases, the task computation times become of little importance, and the breakdown utilization converges to a constant determined by the task periods. For uniformly distributed tasks, a breakdown utilization of 88% is a reasonable characterization. A case is shown in which the average-case breakdown utilization reaches the worst-case lower bound of C.L. Liu and J.W. Layland (1973). >

1,582 citations


"A real-time locking protocol" refers background in this paper

  • ...An exact characterization of rate-monotonic schedulability can be found in [ 12 ]....

    [...]

Frequently Asked Questions (1)
Q1. What are the contributions mentioned in the paper "A real-time locking protocol" ?

In this paper, the authors examine a prioritydriven two-phase lock protocol called the reador write-priority ceiling protocol. The authors show that this protocol is free of deadlock, and in addition a high-priority transaction can be blocked by lower priority transactions for at most the duration of a single embedded transaction. The authors then evaluate system performance experimentally.