Information Technology Reference
In-Depth Information
Another approach is to avoid deadlock by only granting resources if granting
them cannot result in a deadlock situation later on, but this works only if the system
knows what requests for resources a process will be making in the future, which is
an unrealistic assumption. Yet another approach is deadlock avoidance. Deadlock
avoidance is a strategy in which whenever a resource is requested, it is only granted
if it cannot result in deadlock. Deadlock prevention strategies involve changing the
rules so that processes will not make requests that could result in deadlock.
A variant of deadlock called live-lock is a situation in which two or more pro-
cesses continuously change their state in response to changes in the other processes
without doing any useful work. This is similar to deadlock in that no progress is made
but differs in that neither process is blocked or waiting for anything. Some special-
ized systems have deadlock avoidance/prevention mechanisms. For example, many
database operations involve locking several records, which can result in deadlock, so
database software often has a deadlock-prevention algorithm.
17.6
PERFORMANCE OPTIMIZATION
There are many approaches available to optimize performance. Indeed, identifying
sections of wasteful or unneeded code is probably the first step in optimizing a real-
time system. Several approaches are available today to optimize software; however,
this topic concentrates more on the approaches that are most effective in real-time
systems. It should be noted that all processing should be done at the slowest rate that
can possible be tolerated by the system (LaPlante, 2002).
17.6.1
Look-Up Tables
A look-up table is a technique used to speed up computation time and especially
is used in an application such as a real-time system, where time is of the essence.
Look-up tables are used particularly in the implementation of continuous functions
such as exponential sine, cosine, and tangent.
A look-up table can be defined as an array that holds a set of precomputed
results for a given operation. 34 The array provides access to the results that is faster
than computing each time of the result of the given operation. For this reason,
look-up tables typically are used in real-time data acquisition and in processing
systems, especially embedded systems, because of their demanding and strict timing
restriction. However, look-up tables require a considerable amount of execution time
to initialize the array, but in real-time systems, it is in general acceptable to have a
delay during the initialization of the application.
The snippet of code below represents a real-time data acquisition and processing
system in which data are sampled as eight-bit numbers, representing positive values
from 0 to 255. In this example, the required processing involves computing the square
34 http://www.mochima.com/articles/LUT/LUT.html
Search WWH ::




Custom Search