Top Banner
26

Real time-system

Nov 13, 2014

Download

Technology

ysush

what is real time system? how they are scheduled? what is EDF? what is RMA? EDF vs RMA?
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Real time-system
Page 2: Real time-system

REAL TIME SYSTEM

A Real Time System is any information processing system which has to respond to externally generated input stimuli within a finite & specified period.

In real time computing , the correctness of the computation depends not only on the logical results but also on the time at which the results are produced.

Page 3: Real time-system

In RTS a substantial fraction of the design effort goes into making sure that the task deadlines are met.

A Deadline is a given time after a triggering event , by which a response has to be completed.

Page 4: Real time-system

RTS ON THE BASIS OF DEADLINES

1. Hard real time

systems 2. Soft real time systems

Page 5: Real time-system

Hard Real Time SystemsSystem should meets the timings constraints.Response time overrun leads to disastrous damage

Example : Flight Control System

SOFT REAL TIME SYSTEMS Deadline overruns are tolerable, but

not desired. There are no catastrophic

consequences of missing one or more deadlines.

Example : Multimedia System

Page 6: Real time-system

ISSUES IN RTS

Operating System Issues

Architectural Issues

Other Issues

Page 7: Real time-system

SCHEDULABILITY

By task scheduling , we means that a computer’s resources must be shared out equitably among the users.

In general-purpose system , Round robin scheduling is used , which ensures that user does not get a disproportionate share of the computer’s services.

But Round robin scheduling approach does not work in Real Time applications because priority scheduling makes the difference in the two.

Page 8: Real time-system

CHARACTERSTICS

Computation

Offline (precomputed)

Online (Dynamically)

Scheduling

Preemptive

NonPreemptive

Page 9: Real time-system

ASSUMPTIONS MADE IN RTS SCHEDULING

A1. No task has any non- preempt able section & cost of preemption is negligible.

A2. Only processing requirements are significant; memory, I/O & other resource requirements are negligible.

A3. All tasks are independent.

A4. The deadline of a task is equal to its period.

A5. All the tasks in the task set are periodic.

Page 10: Real time-system

Earliest Deadline First (EDF)

Optimal uniprocessor algorithm Also known as Deadline Monotonic

Scheduling algorithm Tasks are preemptable Dynamic priorities Scheduler picks task , whose deadline

is due next A set of tasks is schedulable ( in hard

real time sense ) , if the total processor utilization is not greater than 1.

Page 11: Real time-system

NECESSARY & SUFFICIENT CONDITION

In EDF , for a task set is said to be schedulable is if it satisfy the following necessary and sufficient condition : Σ(i=1 to n) ei / pi

≤ 1

Page 12: Real time-system

Example

Consider 3 periodic processes scheduled using  EDF, the following acceptance test shows that all deadlines will be met.

ProcessExecution Time =

ei

Period = pi

P1 1 8

P2 2 5

P3 4 10

Page 13: Real time-system

The utilization will be:

U = { ( 1/8 ) + ( 2/5 ) + ( 4/10 ) }

= 0.925 ( or 92.5 % )

The theoretical limit for any number of processes is 100% ( or less than 1 ) and so the system is schedulable .

Page 14: Real time-system

EDF Revisited: Schedulability test

Different possible scenarios

If di ≥ pi If di < pi

∑ ei/pi ≤ 1 ∑ ei/di ≤ 1

Necessary and sufficient

Sufficient but NOTnecessary

Processor demand Based test

Fail

Schedulable

Pass

Necessary and sufficient

Page 15: Real time-system

•Optimality•Reduces

number of task switches

ADVANTAGES

•Deteriorates badly under overload

•Scheduling is more expensive

•Needs smarter scheduler

DRAWBACKS

Page 16: Real time-system

Rate Monotonic Algorithm (RMA)

Static priority based algorithm : tasks scheduled according to priorities

Classical uniprocessor scheduling algorithm

Also called Liu-Layland algorithm or Clock driven uniprocessor algorithm

Tasks are pre-emptable

Page 17: Real time-system

STATEMENT

It says that if the total utilization of the task is not greater than n(21/n -1) where n stands for number of tasks to be scheduled then RM algorithm will schedule all the task to meet their respective deadlines.

The RMA assigns priorities to the tasks based on their rate of occurrence, i.e. the lower the occurrence rate of the task the lower the priority assigned to it.

Page 18: Real time-system

In RMA the priority of the task is directly proportional to its rate of occurrence or it is inversely proportional to the period

Page 19: Real time-system

NECESSARY CONDITION

A set of periodic real time tasks would not be RMA schedulable unless they satisfy the following necessary condition:-

Σ(i=1 to n) Ui = Σ(i=1 to n) ei / pi ≤ 1

Page 20: Real time-system

SUFFICIENT CONDITION

Also referred to as Liu and Layland’s condition.

It implies that a set of ‘n’ real time periodic tasks are schedulable under RMA if :

Σ(i=1 to n) Ui ≤ n (21/n -1)

Page 21: Real time-system

If the set of tasks satisfies this sufficient condition then it is guaranteed that the set of tasks would be RMA schedulable.

CASES :Consider the case when • there is only 1 task in the system, i.e., n=1

U1 = 1• there is 2 tasks in the system, i.e., n=2

U2 = 0.824• n=∞, applying L’Hospitals Rule

ln 2 = 0.69

CONCLUSION:From above computation it is clear that maximum CPU utilization that can be achieved under RMA is 1.

Page 22: Real time-system

EXAMPLE

TASK EXECUTION TIME

PERIOD

T1 20 100

T2 30 150

T3 60 200

Consider 3 tasks to be scheduled using  RMA, the following acceptance test determines whether that all deadlines will be met or not.

Page 23: Real time-system

SOLUTION

Checking for the NECESSARY CONDITION :

Σ(i=1 to n) Ui = Σ(i=1 to n) ei / pi ≤ 1

U1 0.2

U2 0.2

U3 0.3

Σ(i=1 to 3) U 0.7

Page 24: Real time-system

Checking for the SUFFICIENT CONDITION :

Σ(i=1 to n) Ui ≤ n(21/n -1)

For n=3,n(21/n -1) = 3(21/3 -1) = 0.78 < 1

Ui = 0.7 < 0.78

Hence, sufficient condition is satisfied.Therefore, all the given three tasks are schedulable under RMA.

Page 25: Real time-system

•possesses good transient overload handling

Advantages

•difficult to support aperiodic and sporadic tasks

•not optimal when task periods and deadlines differ

Disadvantages

Page 26: Real time-system

EDF RMA

EDF is also called Deadline-Monotonic Scheduling algorithm

Dynamic priority algorithm

Tasks do not have to be periodic

Full processor can be feasibly scheduled, if utilization of task set is no greater than 1

It requires a run time overhead. Deteriorates during overload conditions

RMA is also called Liu-Layland algorithm.

Static priority algorithm

All tasks are assumed to be periodic

It lacks flexibility. For e.g. RMA assumes that tasks are infinitely preempt able.

Simpler implementation, even in systems without explicit support for timing constraints (periods, deadlines)