Documente Academic
Documente Profesional
Documente Cultură
Real-time system:-
External World
System
t t+∆t ∆t is fixed
Real-time Embedded Systems- Lecture 02
A Hard Real Time system is one where Soft Real Time is a property of
the computation has no value whatsoever timeliness of a computation where the
value of computation decreases
if the time constraint is not met. according to its tardiness (delay).
READY
BLOCKED
RUNNING
Real-time Embedded Systems- Lecture 02
Scheduling in RTOS
Round Robin
•
•Function Pointer with Interrupts
Round Robin
Real-time Embedded Systems- Lecture 02
Void isr2( )
{
Place function pointer two in queue;
}
Real-time Embedded Systems- Lecture 02
Priority Based
Real-time Embedded Systems- Lecture 02
Assumptions
•Tasks become ‘ready’ based on triggers from external events or other tasks
•and such triggers (aka requests) are periodic
•Once triggered, each task is completed before the next trigger comes
A few definitions
C1, C2, C3,…Cm be the runtimes ( maximum time taken by a task to execute
without being preempted)
T1,T2,T3,…Tm be the periods at which the tasks receive triggers (requests)
(Task periodicity)
Response time: Time interval between the instant at which request for a
task arrives and the instant at which the response for the
request is completed.
Critical Instant: The instant at which the response time for a task is maximum
Task deadline: The instant at which the next request for the task arrives
Critical Timezone: Interval between the critical instant and the instant at which
response is completed
Overflow: If a request remains unfulfilled for a deadline
Real-time Embedded Systems- Lecture 02
Theorem 1
A critical instant for a task occurs whenever the request for the task arrives along
with other higher priority tasks.
Assumptions:
•No task has any non-preemptable section and the cost of pre-emption is negligible
•The tasks require more processing than memory and I/O access
Significance: If the total processor utilization by a set of tasks in less than or equal to
a limiting value, then RM scheduling will schedule all the tasks to meet their respective
deadlines.
Real-time Embedded Systems- Lecture 02
Significance of RM scheduling
Let
C1, C2, ….,Cn be the execution times of a set of n tasks
T1, T2, ….,Tn be the periodicity of a set of n tasks
Thus, if any static priority scheduling algorithm can produce a feasible schedule for a
set of n tasks, so can RM scheduling. Converse is not true.
Utilization balanced:The algorithm assigns tasks to processors one by one in such a way
that at the end of each step, the processor utilization remains balanced.
Next-fit: Works in conjunction with RM. Tasks are broken into classes and each
processor handles a set of tasks belonging to a particular task.
Bin-packing: Assigns tasks to processors such that the total processor threshold is
never exceeded. The threshold is set in such a way that uniprocessor
scheduling generates a feasible schedule.
Bidding algorithm: Tasks arrive at processors. A processor which is unable to meet the demand,
offloads it to others. A variant of this is the buddy strategy- an
underloaded processor is a buddy to an overloaded one.
ci bi 1
T m(2 m 1)
i Ti