Check out the new USENIX Web site. next up previous
Next: Attributes of Real-Time Tasks Up: Improving Wait-Free Algorithms for Previous: Introduction

Motivation

Figure: A schematic block diagram of a real-time system.
\begin{figure}\centering\leavevmode
\epsfig{figure=./fig/overview.eps,height=1.5in}\end{figure}

In this paper, we are primarily concerned with communication between a single writer and multiple readers. This is a very common scenario in embedded systems -- ranging from as complex as automotive and industrial control systems to as simple as the controllers in kitchen appliances. Figure 1 shows a typical real-time system. The sensors are used to acquire information from the controlled system. A sensor task reads the data, performs any preprocessing, and distributes the information to the various control tasks. The control tasks perform computations and set the actuators based on this information, so it is important that they obtain uncorrupted, most-recently produced data from the sensor task.

Traditionally, the writer (i.e., sensor task) must pass the data to the readers (i.e., control tasks) by means of mailboxes, one of which is associated with each reader. However, if there is a large disparity in the execution frequencies of the tasks, especially if the sensor read rate is higher than the actuator control output rates, as is common, data messages will queue up in the mailboxes. The reader will obtain outdated messages, and will either have to process these or discard them to acquire the most current information. Generating multiple copies of each message incurs overheads in processor cycles and memory space, both of which are scarce resources in an embedded system. Therefore, the mailbox approach is neither appropriate nor efficient for typical IPC needed in real-time and embedded systems.

State messages are used to alleviate such problems. They were proposed in the MARS project [16] and implemented in ERCOS [25]. The state messages approach associates mailboxes with the writer instead of the readers, so only the writer associated with a particular mailbox can write to it. Furthermore, each message is assumed to include all data that needs to be communicated, so that the single, most current message conveys all information. Since data are time-sensitive, a new message can simply overwrite the previous one, effectively presenting the readers with the most up-to-date information. However, since the writer and readers can access the writer's mailbox concurrently, the readers can potentially read corrupted data if the writer simultaneously writes new data.

There are many synchronization-based algorithms [9,10] designed to ensure that reader tasks will always access uncorrupted messages. As mentioned earlier, synchronization, particularly with locks, can cause many problems of its own. Therefore, in this paper, we focus on wait-free, single-writer, multiple-reader IPC algorithms [24,17,31,7,8]. However, these algorithms have higher space overheads than the synchronization-based algorithms. Even though the worst-case time overhead of these algorithms is significantly lower than that of the synchronization-based ones, the execution overheads can still be significant. Later in this paper, we present a transformation mechanism that takes advantage of the real-time properties of the communicating tasks to reduce both the time and space overheads of this class of algorithms. First, however, we present a brief overview of real-time systems and tasks in the next section.

Figure: Reader and writer execution timelines, and each x denotes a write operation performed by the writer.
\begin{figure}\centering\leavevmode
\epsfig{figure=./fig/reader-writer.eps,width=\columnwidth}\end{figure}



Subsections
next up previous
Next: Attributes of Real-Time Tasks Up: Improving Wait-Free Algorithms for Previous: Introduction
hai huang 2002-03-30