**1. Introduction**

24 Will-be-set-by-IN-TECH

172 Real-Time Systems, Architecture, Scheduling, and Application

Isovic, D., Fohler, G. & Steffens, L. F. (2005). Real-time issues of mpeg-2 playout in resourse

Koren, G. & Shasha, D. (1995). Skip-over: Algorithms and complexity for overloaded systems that allow skips, *Proceedings of the IEEE Real-Time Systems Symposium*. Lamastra, G., Lipari, G. & Abeni, L. (December 3-6, 2001). A bandwidth inheritance algorithm

Lin, C. & Brandt, S. A. (December 5U8, 2005). Improving soft real-time performance through ˝

Lin, K., Natarajan, S. & Liu, J. (1987). Concord: a system of imprecise computation, *Proceedings*

Lipari, G. & Bini, E. (2003). Resource partitioning among real-time applications, *Proceedings*

Liu, C. & Layland, J. (1973). Scheduling algorithms for multiprogramming in a hard-real-time environment, *Journal of the Association for Computing Machinery* 20(1). Liu, J., Lin, K. & Natarajan, S. (1987). Scheduling real-time, periodic jobs using imprecise

Liu, J., Lin, K., Shih, W., Yu, A., Chung, C., Yao, J. & Zhao, W. (1991). Algorithms for scheduling

Liu, J., Shih, W. K., Lin, K. J., Bettati, R. & Chung, J. Y. (1994). Imprecise computations,

Marzario, L., Lipari, G., Balbastre, P. & Crespo, A. (2004). Iris: A new reclaiming algorithm for

Mercer, C. W., Savage, S. & Tokuda, H. (1994). Processor capacity reserves for multimedia

Mok, A. K., Feng, X. & Chen, D. (2001). Resource partition for real-time systems, *Proceedings*

Natarajan, S. (ed.) (1995). *Imprecise and Approximate Computation*, Kluwer Academic

Palopoli, L., Abeni, L., Lipari, G. & Walpole, J. (December 3-5, 2002). Analysis of a

Shih, W., Liu, W. & Chung, J. (1991). Algorithms for scheduling imprecise computations with

Shih, W., Liu, W., Chung, J. & Gillies, D. (1989). Scheduling tasks with ready times and

Shin, I. & Lee, I. (2003). Periodic resource model for compositional real-time guarantees, *Proceedings of the* 24*th Real-Time Systems Symposium*, Cancun, Mexico, pp. 2–13.

timing constraints, *SIAM Journal of Computing* 20(3): 537–552.

deadlines to minimize average error, *Operating System Review* 23(3).

server-based real-time systems, *Proc. of the IEEE Real-Time and Embedded Technology*

operating systems, *Proceedings of IEEE international conference on Multimedia*

*of the* 7*th IEEE Real-Time Technology and Applications Symposium*, Taipei, Taiwan,

reservation-based feedback scheduler, *Proceedings of the 23rd IEEE Real-Time Systems*

for real-time task synchronization in open systems, *IEEE Proceedings of the 22nd*

better slack management, *Proc. of the IEEE Real-Time Systems Symposium (RTSS 2005)*,

*of the* 15*th Euromicro Conference on Real-Time Systems (ECRTS'03)*, Porto, Portugal,

constrained systems, *Journal of Embedded Computing* 1: 239–256.

*Real-Time Systems Symposium (RTSS'01)*, London, UK.

results, *Proceedings of the IEEE Real-Time System Symposium*.

imprecise computations, *IEEE Computer* 24(5): 58–68.

*and Applications Symposium*, Toronto, Canada.

*Proceedings of the IEEE* 82(1): 83–94.

*Symposium (RTSS'02)*, Austin-Texas.

*Computing and System*.

pp. 75–84.

Publishers.

Miami, Florida, USA.

pp. 151–158.

*of the 1987 IEEE Compsac*.

Concurrency control is one of the main issues in the studies of real-time database systems. On the one hand, it is related closely to active real-time database and real-time application. Concurrency control algorithm seriously affect the performance of the system in real-time, may cause unpredictable consequences. On the other hand, updating data in active real-time database may trigger a new transaction and to further increase the difficulty of the concurrency control. How ensures both the consistency of the database and the finish of the transactions before deadline; it is an important problem to the concurrency control research in the active real-time database systems. In the most literature, the existing research more focuses on the transactions deadline and lack of attention the data temporal constraint. This is mainly due to the real-time data is obtained dynamically by sensors in real-time database, and the transactions of real-time databases read the sensor data only, do not write the sensor data. But the real-time data may miss deadline and become invalid before transaction which reads it committed, most concurrency control algorithms are regardless of the sensor data deadline and its invalid effect to systems. This chapter will further discuss the concurrency control method that transactions access real-time sensor data.

Optimism concurrency control method is widely used in real-time database due to no deadlock and no-block characteristics, but delay conflicts detection brings with great restart overhead. A dynamic adjustment serialization order method is proposed to reduce unnecessary affairs restart number [Haritsa, Lindstrom], according to [Lindstrom, Wang] a method is proposed by control the reading and writing data to reduce the transaction restart number. In [Brad] discussed about the relation between real-time data and the derived data validity, and [Kuo] proposed the concept of real-time data similarity. According to [Brad, Xiong] proposed the concept of data-deadline, and the transaction scheduling strategy by using mandatory waiting method. The [Liu] also discuss on data deadline and transaction scheduling. A real-time transaction scheduling method is proposed based on the combination of [Kuo, Son] improving real-time data similarity mechanism in [Xiong]. But [Xiong, Son] only take account of single transaction scheduling the real data problems, not consider the concurrency control problem that the transactions did not arrive at deadline and its accessed data expired, which will increase the number of transactions restart.

Real-Time Concurrency Control Protocol Based on Accessing Temporal Data 175

the lock; if the requester's priority is lower, it waits for the lock holders to release the lock. In addition, a new read lock requester can join a group of read lock holders only if its priority is higher than that of all waiting write lock operations. This protocol is referred to as 2PL-HP. It is important to note that 2PL-HP loses some of the basic 2PL algorithm's blocking

Note that High Priority scheme is similar to Wound-Wait scheme, which is added to twophase locking for deadlock prevention. The only difference is that High Priority scheme uses priority order decided by transaction timing constraints for conflict resolution decisions, while Wound-Wait employs timestamp order usually decided by transaction arrival time. It is obvious that High Priority serves as a deadlock prevention mechanism, if the priority assignment mechanism assigns unique priority value to a transaction and does not dynamically change the relative priority ordering of concurrent transactions. Also, note that 2PL-HP is free from priority inversion problem, because a higher priority transaction never

In 2PL-WP (2PL Wait Promote) [Huang] the analysis of concurrency control method is enhanced from [Lindstrom]. The mechanism presented uses shared and exclusive locks. Shared locks permit multiple concurrent readers. A new definition is made – the priority of a data object, which is defined to be the highest priority of all the transactions holding a lock

A transaction can join in the read group of an object only if its priority is higher than the maximum priority of all transactions in the write group of an object. Thus, conflicts arise from incompatibility of locking modes as usual. Particular care is given to conflicts that lead to priority inversions. A priority inversion occurs when a transaction of high priority requests and blocks for an object which has lesser priority. This means that all the lock holders have lesser priority than the requesting transaction. This same method is also called

Sometimes High Priority may be too strict policy. If the lock holding transaction Th can finish in the time that the lock requesting transaction Th can afford to wait, that is within the slack time of Tr, and let Th proceed to execution and Tr B wait for the completion of Th. This policy is called 2PL-CR (2PL Conditional Restart) or 2PL-CPI (2PL Conditional Priority

In Priority Ceiling Protocol [Sha] the aim is to minimize the duration of blocking to at most one elementary lower priority task and prevent the formation of deadlocks. A real-time database can often be decomposed into sets of database objects that can be modelled as atomic data sets. For example, two radar stations track an aircraft representing the local view in data objects O1 and O2. These objects might include e. g. the current location, velocity, etc. Each of these objects forms an atomic data set, because the consistency constraints can be checked and validated locally. The notion of atomic data sets is especially

A simple locking method for elementary transactions is the two-phase locking method; a transaction cannot release any lock on any atomic data set unless it has obtained all the locks on that atomic data set. Once it has released its locks it cannot obtain new locks on the same atomic data set, however, it can obtain new locks on different data sets. The theory of

factor due to the partially restart-based nature of the High Priority scheme.

on the data object. If the data object is not locked, its priority is undefined.

waits for a lower priority transaction, but restarts it.

2PL-PI (2PL Priority Inheritance) [Stankovic].

Inheritance) [Lam, Menasce].

useful for tracking multiple targets.

The chapter is organized as follows. Section 2 reviews concurrency control protocols proposed in real-time database systems (RTDBSs) and describes our choice of concurrency control algorithms for accessing temporal data. Section 3 analyzes the validity of active realtime system model and the effects real-time data to the concurrent control. The relevant definition and the effective examination mechanism of transaction reading data were given in Section 4. In Section 5 based on Data temporal characteristics, concurrency control algorithm RTCC-DD (Real-time Concurrency Control Algorithm Based on Data-deadline) is put forward, and proved that the RTCC-DD was the correctness in theory. Section 6 carries on the analysis comparison between our proposed method and the existed method through experiment. Finally, Section 7 gives summary and conclusions of this chapter and future directions for the work.