1. Projects

# Real-time Scheduling

Much real-time computing operates in an environment like the following

1. Groups of sensors that provide polling with fixed periodicity
2. Sensor input triggers tasks which also run with fixed periodicity

Typical example, a group of sensors that returns

• the rotational speed of the wheels, and
• the exhaust mixture, and
• the torque, and ...

and a set of tasks that

• updates the engine parameters, and
• updates the transmission parameters, and
• passes the speed on to the instrument controller, and ...

Each time a sensor returns a new datum a scheduler runs

3. starts it running.

Your kernel can handle problems like this one pretty efficiently,

• but you can do better.

## Cyclic Execution

Let's make a schedule

```                                               A                                       A
AC  BA    A C  A    A  C A    A B CA    A    C    A    AC B A    A C  A    A  C A    B
|    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |    |
|                           |                         |                          |
|          |          |          |          |          |          |          |
________________________________________________________________________________________________________ time```

Because the times are integers the pattern repeats after a while.

• The total amount of thinking you have to do is finite.
• The thinking you do is inserting into the schedule the amount of processing that needs to be done
• worst case
• Work it all out so that nothing collides.
• using heuristics, no doubt

#### Make it a little easier

1. Make the complete pattern short by making sensor periods multiples of one another
• You control sensor periods,
• but only up to a point.
2. Standardize the processing at each point
3. Minimize the interaction between tasks
4. Prove some theorems, such as Liu & Layland

### Theorems

Important assumptions

• No interaction execpt contention for CPU
• Task must finish processing event n before event n+1 occurs

Main idea

• Identify the bottleneck
• We call this the critical instant for a task.

Main result

• A method for deriving priorities from task characteristics
• rate-monotone scheduling

Subsidiary result

• Maximum possible CPU utilization

# More Interesting Cyclic Execution

For example: mobile phone, iPod, digital assistant, etc

An easier design environment