MODEL OF
REAL-TIME
SYSTEM
PRESENTED
BY:
MANOJ
KHADKA
1
ACCORDING TO REFERENCE MODEL, A
SYSTEM IS CHARACTERIZED BY THREE
ELEMENTS:-
(1)a workload model that describes the applications supported by the system,
 Temporal parameters
 Precedence constraints and dependencies
 Functional parameters
(1)a resource model that describes the system resources available to the applications,
(2)algorithms that define how the application system uses the resources at all times
2
PROCESSORS AND
RESOURCES
servers and active resources;
computers, transmission links,
disks, and database server are
examples of processors
 Every job must have one or more
processors in order to execute
and make progress toward
completion
resources are memory, sequence
numbers, mutexes, and
database lock
 A job may need some resources in
addition to the processor in
order to make progress
3
Temporal Parameters of Real-Time
Workload
Its temporal parameters that tell us its timing constraints
and behavior. Its interconnection parameters describe how
it depends on other jobs and how other jobs depend on it.
Release time (ri)
Relative deadline(Di)
Absolute deadline(di)
Execution time(ei)
4
Fixed, Jittered, and Sporadic
Release Times
Fixed: we do know the actual release time ri of each job .
Jitter: we do not know the actual release time ri of each job Ji ; only that ri is in a range [ri− , ri+ ].
Sporadic/aperiodic : they are released at random time instants.
5
APERIODIC AND SPORADIC TASKS
 a task is aperiodic if the jobs in it have either soft deadlines or no deadlines.
 Tasks containing jobs that are released at random time instants and have
hard deadlines are sporadic tasks.
6
PERIODIC TASK MODEL
 each computation or data transmission that is executed
repeatly at regular or semiregular time intervals in order
to provide a function of the system on a continuing basis
is modeled as a period task
 such as digital control, real-time monitoring, and constant
bit-rate voice/video transmission
 Four tuples (φi(phase), pi(periods), ei, Di(relative deadline))
7
PRECEDENCE CONSTRAINTS
• jobs are said to have precedence constraints if they are constrained to execute in some order
Example:
• For example, in a radar surveillance system, the signal-processing task is the producer of track records,
while the tracker task is the consumer. In particular, each tracker job processes the track records
generated by a signal-processing job. The designer may choose to synchronize the tasks so that the
execution of the kth tracker job does not begin until the kth signal-processing job completes.
8
PRECEDENCE GRAPH AND TASK
GRAPH
• Jobs are either precedence constrained or independent
• Precedence relation:
->partial ordering operator <
->Ji < Jk : Ji is a predecessor of Jk , Jk a successor of Ji
->directed graph : G=(J,<)
• Task graph is an extended precedence graph
9
TASK GRAPH
• gives us a general way to describe the application system
• the vertices in a task graph represent jobs
• shown as circles and squares
• numbers in the bracket above each job give its feasible interval
• edges in the graph represent dependencies among jobs
• If all the edges are precedence edges, representing precedence constraints, then the graph is a
precedence graph
10
DATA DEPENDENCY
• a situation in which a program statement (instruction) refers to the data of a preceding statement
• there is a data-dependency edge from a vertex Ji to vertex Jk in the task graph if the job Jk consumes
data generated by Ji or the job Ji sends messages to Jk
• A parameter of an edge from Ji to Jk is the volume of data from Ji to Jk
11
OTHER DEPENDENCIES
• Temporal Dependency
• AND/OR Precedence Constraints
• Conditional Branches
• Pipeline Relationship
12
TEMPORAL DEPENDENCY
• In task graph, temporal distance constraints among jobs are represented by temporal-dependency edge
• There is a temporal dependency edge from a vertex Ji to Jk if the job Jk must be completed within a
certain time after Ji completes.
• The value of this parameter is infinite if jobs have no temporal distance constraints or there is no
temporal dependency edge among the jobs
13
AND/OR PRECEDENCE
CONSTRAINTS
• A job with one or more than one immediate predecessor that must wait until all of its predecessor are
executed is AND jobs
• The dependencies among theme AND precedence constraints
• These are represented by unfilled circles in the task graph
• OR jobs are the job that can begin execution at or after its release time provided one or more of its
immediate predecessor has been completed
• It is represented by square vertices
14
CONDITIONAL BRANCHES
• all the immediate successors of a job must be completed before the job to be executed
• This convention makes it inconvenient for us to represent conditional execution of job
• Let us consider the program shown below:
15
A Program with conditional branches 16
PIPELINE RELATIONSHIP
• In task graph, the vertices are granules of producer and consumer
• Each consumer granule can begin execution when previous granules of job and the producer job have
been completed
• We represent the pipeline relationship between edges with the dotted lines
• There is an pipeline edge from Ji to Jk if o/p of Ji is piped into Jk and execution of Jk can proceed as long
as there are data for it to proceed
17
FUNCTIONAL PARAMETERS
• Main function parameters include:-
• Preemptivity of jobs
• Criticality of jobs
• Optional execution
• Laxity type and laxity function
18
PREEMPTIVITY OF JOBS
• Preemptable:-Can be suspended and resumed form the suspension point
• Non-preemptable jobs:-it must be implemented from start time to completion time without
preemption
19
CRITICALITY OF THE JOBS
• Criticality of jobs:-positive number indicating how critical the job is
• Value increases with importance of job
• Here we don’t use the terms priority and weight
20
OPTIONAL EXECUTION
• If an optional job or optional portion completes late or is not executed at all, the system still functions
satisfactorily
• Non-optional job:- mandatory
21
LAXITY TYPE AND LAXITY FUNCTIONS
• Laxity type of a job means whether its timing constraints are hard or soft.
• Laxity type is supplemented by a usefulness function
• This function gives the usefulness of the result produced by the job as a function of its tardiness
• The tardiness is the difference between the completion time and deadline of the job.
22
USEFULNESS OF THE FUNCTION
23
RESOURCE PARAMETER OF JOBS AND PARAMETER OF
RESOURCES
• Preemptivity of resource
• Resource Graph
24
PREEMPTIVITY
• If a job can use every unit of resource in a interleaved fashion, the resource is called preemptable
• A resource is non-preemptable if each unit of the resource is constrained to be used serially
25
RESOURCE GRAPH
• A graph that is used to describe the configuration of the resources
• Vertex Ri for every processor or resource Ri in the system
• Attributes of the vertex are the parameters of the resources
• p- processor R- passive resources
• Parameters
 Type
 No. of available units
26
SCHEDULING HIERARCHY
27
SCHEDULING HIERARCHY
• Task Graph
 Representation of application system
 Processor time
 Resource requirement
 Timing constraints & dependencies of the job
• Resource graph
 Amount of attributes
 Resource attributes
 Usage rules
• Scheduling and resource access control algorithm used by the operating system
28
SCHEDULER AND SCHEDULE
• Scheduler
 Implements scheduling algorithm
 Schedule jobs
 Allocate resources
Example :-processor assignments on jobs(or vice-versa)
• Schedule
 A schedule is an assignment of all jobs in the system on the available processors.
29
VALID SCHEDULES
• Every processor is assigned at most one job at any time.
• Every job is assigned at most one processor at any time.
• No job is scheduled before its release time.
• The total amount of processor time assigned to every job is equal to its maximum or actual execution
time.
• All the precedence and resource usage constraints are satisfied.
30
FEASIBILITY, OPTIMALITY AND PERFORMANCE MEASURES OF
SCHEDULING
• A valid schedule is also a feasible schedule if every job meets its timing constraints or completes by its
deadline
• A job is a schedulable according to a scheduling algorithm, if the scheduler always produces a feasible
schedule
• Miss Rate: The percentage of jobs that are executed but completed too late
• Loss Rate: The percentage of jobs that are not executed at all or discarded
The other performance measures are maximum and average tardiness, response time, miss/loss and invalid rates
31
BIBLIOGRAPHY
• https://www.kullabs.com/classes/subjects/units/lessons/notes/note-detail/4508
32

Reference Model of Real Time System

  • 1.
  • 2.
    ACCORDING TO REFERENCEMODEL, A SYSTEM IS CHARACTERIZED BY THREE ELEMENTS:- (1)a workload model that describes the applications supported by the system,  Temporal parameters  Precedence constraints and dependencies  Functional parameters (1)a resource model that describes the system resources available to the applications, (2)algorithms that define how the application system uses the resources at all times 2
  • 3.
    PROCESSORS AND RESOURCES servers andactive resources; computers, transmission links, disks, and database server are examples of processors  Every job must have one or more processors in order to execute and make progress toward completion resources are memory, sequence numbers, mutexes, and database lock  A job may need some resources in addition to the processor in order to make progress 3
  • 4.
    Temporal Parameters ofReal-Time Workload Its temporal parameters that tell us its timing constraints and behavior. Its interconnection parameters describe how it depends on other jobs and how other jobs depend on it. Release time (ri) Relative deadline(Di) Absolute deadline(di) Execution time(ei) 4
  • 5.
    Fixed, Jittered, andSporadic Release Times Fixed: we do know the actual release time ri of each job . Jitter: we do not know the actual release time ri of each job Ji ; only that ri is in a range [ri− , ri+ ]. Sporadic/aperiodic : they are released at random time instants. 5
  • 6.
    APERIODIC AND SPORADICTASKS  a task is aperiodic if the jobs in it have either soft deadlines or no deadlines.  Tasks containing jobs that are released at random time instants and have hard deadlines are sporadic tasks. 6
  • 7.
    PERIODIC TASK MODEL each computation or data transmission that is executed repeatly at regular or semiregular time intervals in order to provide a function of the system on a continuing basis is modeled as a period task  such as digital control, real-time monitoring, and constant bit-rate voice/video transmission  Four tuples (φi(phase), pi(periods), ei, Di(relative deadline)) 7
  • 8.
    PRECEDENCE CONSTRAINTS • jobsare said to have precedence constraints if they are constrained to execute in some order Example: • For example, in a radar surveillance system, the signal-processing task is the producer of track records, while the tracker task is the consumer. In particular, each tracker job processes the track records generated by a signal-processing job. The designer may choose to synchronize the tasks so that the execution of the kth tracker job does not begin until the kth signal-processing job completes. 8
  • 9.
    PRECEDENCE GRAPH ANDTASK GRAPH • Jobs are either precedence constrained or independent • Precedence relation: ->partial ordering operator < ->Ji < Jk : Ji is a predecessor of Jk , Jk a successor of Ji ->directed graph : G=(J,<) • Task graph is an extended precedence graph 9
  • 10.
    TASK GRAPH • givesus a general way to describe the application system • the vertices in a task graph represent jobs • shown as circles and squares • numbers in the bracket above each job give its feasible interval • edges in the graph represent dependencies among jobs • If all the edges are precedence edges, representing precedence constraints, then the graph is a precedence graph 10
  • 11.
    DATA DEPENDENCY • asituation in which a program statement (instruction) refers to the data of a preceding statement • there is a data-dependency edge from a vertex Ji to vertex Jk in the task graph if the job Jk consumes data generated by Ji or the job Ji sends messages to Jk • A parameter of an edge from Ji to Jk is the volume of data from Ji to Jk 11
  • 12.
    OTHER DEPENDENCIES • TemporalDependency • AND/OR Precedence Constraints • Conditional Branches • Pipeline Relationship 12
  • 13.
    TEMPORAL DEPENDENCY • Intask graph, temporal distance constraints among jobs are represented by temporal-dependency edge • There is a temporal dependency edge from a vertex Ji to Jk if the job Jk must be completed within a certain time after Ji completes. • The value of this parameter is infinite if jobs have no temporal distance constraints or there is no temporal dependency edge among the jobs 13
  • 14.
    AND/OR PRECEDENCE CONSTRAINTS • Ajob with one or more than one immediate predecessor that must wait until all of its predecessor are executed is AND jobs • The dependencies among theme AND precedence constraints • These are represented by unfilled circles in the task graph • OR jobs are the job that can begin execution at or after its release time provided one or more of its immediate predecessor has been completed • It is represented by square vertices 14
  • 15.
    CONDITIONAL BRANCHES • allthe immediate successors of a job must be completed before the job to be executed • This convention makes it inconvenient for us to represent conditional execution of job • Let us consider the program shown below: 15
  • 16.
    A Program withconditional branches 16
  • 17.
    PIPELINE RELATIONSHIP • Intask graph, the vertices are granules of producer and consumer • Each consumer granule can begin execution when previous granules of job and the producer job have been completed • We represent the pipeline relationship between edges with the dotted lines • There is an pipeline edge from Ji to Jk if o/p of Ji is piped into Jk and execution of Jk can proceed as long as there are data for it to proceed 17
  • 18.
    FUNCTIONAL PARAMETERS • Mainfunction parameters include:- • Preemptivity of jobs • Criticality of jobs • Optional execution • Laxity type and laxity function 18
  • 19.
    PREEMPTIVITY OF JOBS •Preemptable:-Can be suspended and resumed form the suspension point • Non-preemptable jobs:-it must be implemented from start time to completion time without preemption 19
  • 20.
    CRITICALITY OF THEJOBS • Criticality of jobs:-positive number indicating how critical the job is • Value increases with importance of job • Here we don’t use the terms priority and weight 20
  • 21.
    OPTIONAL EXECUTION • Ifan optional job or optional portion completes late or is not executed at all, the system still functions satisfactorily • Non-optional job:- mandatory 21
  • 22.
    LAXITY TYPE ANDLAXITY FUNCTIONS • Laxity type of a job means whether its timing constraints are hard or soft. • Laxity type is supplemented by a usefulness function • This function gives the usefulness of the result produced by the job as a function of its tardiness • The tardiness is the difference between the completion time and deadline of the job. 22
  • 23.
    USEFULNESS OF THEFUNCTION 23
  • 24.
    RESOURCE PARAMETER OFJOBS AND PARAMETER OF RESOURCES • Preemptivity of resource • Resource Graph 24
  • 25.
    PREEMPTIVITY • If ajob can use every unit of resource in a interleaved fashion, the resource is called preemptable • A resource is non-preemptable if each unit of the resource is constrained to be used serially 25
  • 26.
    RESOURCE GRAPH • Agraph that is used to describe the configuration of the resources • Vertex Ri for every processor or resource Ri in the system • Attributes of the vertex are the parameters of the resources • p- processor R- passive resources • Parameters  Type  No. of available units 26
  • 27.
  • 28.
    SCHEDULING HIERARCHY • TaskGraph  Representation of application system  Processor time  Resource requirement  Timing constraints & dependencies of the job • Resource graph  Amount of attributes  Resource attributes  Usage rules • Scheduling and resource access control algorithm used by the operating system 28
  • 29.
    SCHEDULER AND SCHEDULE •Scheduler  Implements scheduling algorithm  Schedule jobs  Allocate resources Example :-processor assignments on jobs(or vice-versa) • Schedule  A schedule is an assignment of all jobs in the system on the available processors. 29
  • 30.
    VALID SCHEDULES • Everyprocessor is assigned at most one job at any time. • Every job is assigned at most one processor at any time. • No job is scheduled before its release time. • The total amount of processor time assigned to every job is equal to its maximum or actual execution time. • All the precedence and resource usage constraints are satisfied. 30
  • 31.
    FEASIBILITY, OPTIMALITY ANDPERFORMANCE MEASURES OF SCHEDULING • A valid schedule is also a feasible schedule if every job meets its timing constraints or completes by its deadline • A job is a schedulable according to a scheduling algorithm, if the scheduler always produces a feasible schedule • Miss Rate: The percentage of jobs that are executed but completed too late • Loss Rate: The percentage of jobs that are not executed at all or discarded The other performance measures are maximum and average tardiness, response time, miss/loss and invalid rates 31
  • 32.