0% found this document useful (0 votes)
50 views

Task Structure

Tasks are units of computation that execute on processors. A task may execute multiple times as jobs. Each job has an execution time and release time. A task's period is the time between releases of consecutive jobs. Deadlines specify the maximum response time for a job. Periodic tasks repeat jobs at regular intervals and can be modeled with their period, execution time, deadline, and other parameters. Together these concepts provide a framework for quantifying and scheduling workloads in real-time systems.

Uploaded by

Amir Hakim
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Task Structure

Tasks are units of computation that execute on processors. A task may execute multiple times as jobs. Each job has an execution time and release time. A task's period is the time between releases of consecutive jobs. Deadlines specify the maximum response time for a job. Periodic tasks repeat jobs at regular intervals and can be modeled with their period, execution time, deadline, and other parameters. Together these concepts provide a framework for quantifying and scheduling workloads in real-time systems.

Uploaded by

Amir Hakim
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

Real Time System

Task and Resources


Task Structure
• A Task is the unit for computation, normally exist as a piece of code
• A task normally exist as a piece of code which performs some functionality for a
system
• Processor executes the task

• Each iteration of a task is call a job


Execution Time
• A job Ji will execute for time ei
– This is the amount of time required to complete the execution of Ji when it executes alone and has all
the resources it needs

– Value of ei depends upon complexity of the job and speed of the processor on which it is scheduled;
may change for a variety of reasons:
• Conditional branches
• Cache memories and/or pipelines
• Compression (e.g. MPEG video frames)

– Execution times fall into an interval [ei−, ei +]; assume that we know this interval for every hard real-
time job, but not necessarily the actual ei
• Terminology: (x, y] is an interval starting immediately after x, continuing up to and including

• Often, we can validate a system using ei + for each job; we assume ei = ei+ and
ignore the interval lower bound
– Inefficient, but safe bound on execution time
Release and Response Time
• Release time – the instant in time when a job becomes available for
execution
– May not be exact: Release time jitter so ri is in the interval [ri−, ri+]
– A job can be scheduled and executed at any time at, or after, its release time, provided its data and
control dependency conditions are met

• Response time – the length of time from the release time of the job to the time
instant when it completes
– Not the same as execution time, since may not execute continually
Deadline and Timing Constraint
• Completion time – the instant at which a job completes execution
• Relative deadline – the maximum allowable response time of a job
• Absolute deadline – the instant of time by which a job is required to be completed (often called
simply the deadline)
– absolute deadline = release time + relative deadline
– Feasible interval for a job Ji is the interval (ri, di)

• Deadlines are examples of timing constraints


Example
• A system to monitor and control a heating furnace
– The system takes 20ms to initialize when turned on
– After initialization, every 100 ms, the system:
• Samples and reads the temperature sensor
• Computes the control-law for the furnace to process temperature readings, determine the correct flow rates of
fuel, air and coolant
• Adjusts flow rates to match computed values

• The periodic computations can be stated in terms of release times of the jobs computing the
control-law: J0, J1, …, Jk, …

– The release time of Jk is 20 + (k × 100) ms


Example…cont
• Suppose each job must complete before the release of the next job:
– Jk’s relative deadline is 100 ms
– Jk’s absolute deadline is 20 + ((k + 1) × 100) ms
• Alternatively, each control-law computation may be required to finish sooner – i.e. the relative
deadline is smaller than the time between jobs, allowing some slack time for other jobs
Modelling Periodic Tasks
• A set of jobs that are executed repeatedly at regular time intervals can be
modelled as a periodic task
• Each periodic task Ti is a sequence of jobs Ji,1, Ji,2, …, Ji,n
• The phase of a task Ti is the release time ri,1 of the first job Ji,1 in the task. It is
denoted by ϕi (“phi”)
• The period pi of a task Ti is the minimum length of all time intervals between release
times of consecutive jobs
• The execution time ei of a task Ti is the maximum execution time of all jobs in the
periodic task
• The period and execution time of every periodic task in the system are known with
reasonable accuracy at all times
• Ti ={ ϕi ,Pi , ei , Di }

• The hyper-period of a set of periodic tasks is the least common multiple of


their periods: H = lcm(pi) for i = 1, 2, …, n
• The time after which the pattern of job release/execution times starts to repeat
Modelling Periodic Tasks
• The ratio ui = ei/pi is the utilization of task Ti
• The fraction of time a periodic task with period pi and execution time eikeeps
a processor busy
• The total utilization of a system is the sum of the utilizations of all
tasks in a system: U = Σui
• We will usually assume the relative deadline for the jobs in a task is
equal to the period of the task
• It can sometimes be shorter than the period, to allow slack time
Illustrating the task structure
• Quantify the workload into discrete pieces, referred to as a Task
• Quantify the workload into discrete pieces, referred to as a Task
• Quantify the workload into discrete pieces, referred to as a Task
Summary

You might also like