Book Image

The Complete Edition - Software Engineering for Real-Time Systems

By : Jim Cooling
Book Image

The Complete Edition - Software Engineering for Real-Time Systems

By: Jim Cooling

Overview of this book

From air traffic control systems to network multimedia systems, real-time systems are everywhere. The correctness of the real-time system depends on the physical instant and the logical results of the computations. This book provides an elaborate introduction to software engineering for real-time systems, including a range of activities and methods required to produce a great real-time system. The book kicks off by describing real-time systems, their applications, and their impact on software design. You will learn the concepts of software and program design, as well as the different types of programming, software errors, and software life cycles, and how a multitasking structure benefits a system design. Moving ahead, you will learn why diagrams and diagramming plays a critical role in the software development process. You will practice documenting code-related work using Unified Modeling Language (UML), and analyze and test source code in both host and target systems to understand why performance is a key design-driver in applications. Next, you will develop a design strategy to overcome critical and fault-tolerant systems, and learn the importance of documentation in system design. By the end of this book, you will have sound knowledge and skills for developing real-time embedded systems.
Table of Contents (16 chapters)
Preface
15
Glossary of terms

5.4 Contention Problems in Multitasking Systems

5.4.1 Resource Contention and Deadlocks

The previous section has shown that tasks can safely share resources as long as we employ robust mutual exclusion techniques. Unfortunately, there is the possibility that the use of these mechanisms can accidentally produce serious runtime problems (the law of unintended consequences?). For us, the two most important ones are deadlock and priority inversion. But (and this is a significant but) these problems cannot arise where tasks share one resource only; they must share at least two resources.

Deadlock is the subject of this section; priority inversion is dealt with in the following one. To illustrate these effects, we'll look at the runtime behavior of the example system shown in Figure 5.22:

Figure 5.22: Example system tasking diagram

Its operation should be self-explanatory, but please check that you do understand it. The scheduling policy is a priority...