14 Other Schduling Models

  • Upload
    dugguz

  • View
    221

  • Download
    0

Embed Size (px)

Citation preview

  • 8/9/2019 14 Other Schduling Models

    1/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,Inc.

    1

    REAL TIME OPERATING SYSTEMS

    Lesson-22:

    Other Scheduling MethodsOther Scheduling Methods

  • 8/9/2019 14 Other Schduling Models

    2/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,Inc.

    2

    1. Common scheduling models1. Common scheduling models

  • 8/9/2019 14 Other Schduling Models

    3/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,Inc.

    3

    Common scheduling modelsCommon scheduling models

    Cooperative Scheduling of ready tasks in acircular queue. It closely relates to functionqueue scheduling.

    Cooperative Scheduling with PrecedenceConstraints

    Cyclic scheduling of periodic tasks and RoundRobin Time Slicing Scheduling of equal prioritytasks

    Preemptive Scheduling

    Scheduling using 'Earliest Deadline First' (EDF)precedence.

  • 8/9/2019 14 Other Schduling Models

    4/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,Inc.

    4

    Common scheduling modelsCommon scheduling models

    Rate Monotonic Scheduling using higher rate of

    events occurrence First precedence

    Fixed Times Scheduling

    Scheduling of Periodic, sporadic and aperiodicTasks

    Advanced scheduling algorithms using the

    probabilistic Timed Petri nets (Stochastic) or

    Multi Thread Graph for the multiprocessors andcomplex distributed systems.

  • 8/9/2019 14 Other Schduling Models

    5/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,Inc.

    5

    2. Earliest Deadline First' (EDF)2. Earliest Deadline First' (EDF)

    precedenceprecedence

  • 8/9/2019 14 Other Schduling Models

    6/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,Inc.

    6

    EDFEDF

    When a task becomes ready, its will be considered

    at a scheduling point.

    The scheduler does not assign any priority.

    It computes the deadline left at a scheduling point. Scheduling point is an instance at which the

    scheduler blocks the running task and re-computes

    the deadlines and runs the EDF algorithm and

    finds the task which is to be run

  • 8/9/2019 14 Other Schduling Models

    7/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,Inc.

    7

    EDFEDF

    An EDF algorithm can also maintain a

    priority queue based on the computation

    when the new task inserts

  • 8/9/2019 14 Other Schduling Models

    8/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    8

    3. Rate Monotonic Scheduler3. Rate Monotonic Scheduler

  • 8/9/2019 14 Other Schduling Models

    9/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    9

    Rate Monotonic SchedulerRate Monotonic Scheduler

    Rate monotonic scheduler computes the

    priorities,p, from the rate of occurrence of

    the tasks.

    The i-th task priority,pi is proportional to (

    1/ti) where ti is the period of the occurrence

    of the task event.

  • 8/9/2019 14 Other Schduling Models

    10/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    10

    Rate Monotonic SchedulerRate Monotonic Scheduler

    RMA gives an advantage over EDF because

    most RTOSes have provisions for priority

    assignment. Higher priority tasks always get

    executed

  • 8/9/2019 14 Other Schduling Models

    11/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    11

    4. Precedence Assignment in the4. Precedence Assignment in the

    Scheduling AlgorithmsScheduling Algorithms

  • 8/9/2019 14 Other Schduling Models

    12/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    12

    Precedence Assignment in the SchedulingPrecedence Assignment in the Scheduling

    AlgorithmsAlgorithms

    Best strategy is one, which is based on EDF

    (Earliest Deadline First) precedence.

    Precedence is made the highest for a task

    that corresponds to an interrupt source,

    which occurs at the earliest a succeeding

    times. and which deadline will finish

    earliest at the earliest

  • 8/9/2019 14 Other Schduling Models

    13/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    13

    Precedence Assignment in the SchedulingPrecedence Assignment in the Scheduling

    AlgorithmsAlgorithms

    We assign precedence by appropriate

    strategy in the case of the variable CPU

    loads for the different tasks and variable

    EDFs .

  • 8/9/2019 14 Other Schduling Models

    14/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    14

    Dynamic Precedence AssignmentDynamic Precedence Assignment

    Firstly, there is deterministic or static assignmentof the precedence

    It means firstly there is rate monotonic scheduling

    (RMS).

    Later on the scheduler dynamically assigns and

    fixes the timeout delays afresh, and assigns the

    precedence as per EDF.

    The need for of the dynamic assignment arises due

    to the sporadic tasks and the distributed or

    multiprocessor indeterminate environment.

  • 8/9/2019 14 Other Schduling Models

    15/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    15

    5. Fixed (Static) Real Time Scheduling5. Fixed (Static) Real Time Scheduling

    of the Tasksof the Tasks

  • 8/9/2019 14 Other Schduling Models

    16/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    16

    Fixed (Static) Real Time Scheduling of theFixed (Static) Real Time Scheduling of the

    TasksTasks

    A scheduler is said to be using a fixed time

    scheduling method when the schedule is

    static and deterministic

  • 8/9/2019 14 Other Schduling Models

    17/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    17

    Methods for Fixed (Static) Real TimeMethods for Fixed (Static) Real Time

    SchedulingScheduling

    (i) Simulated annealing method different

    schedules fixed and the performance is

    simulated. Now, schedules for the tasks are

    gradually incremented by changing theinterrupt timer settings (using a

    corresponding OS function) till the

    simulation result shows that none is missing

    its deadline.

  • 8/9/2019 14 Other Schduling Models

    18/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    18

    Methods for Fixed (Static) Real TimeMethods for Fixed (Static) Real Time

    SchedulingScheduling

    (ii)Heuristic method. Here, the reasoning

    or past experience lets us helps to define

    and fixing the fixed schedules.

  • 8/9/2019 14 Other Schduling Models

    19/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    19

    Methods for Fixed (Static) Real TimeMethods for Fixed (Static) Real Time

    SchedulingScheduling

    (iii)Dynamic programming model. This is

    as follows: Certain specific running

    program first determines the schedules for

    each task and then the timer interrupt sloads the timer settings from the outputs

    from that program

  • 8/9/2019 14 Other Schduling Models

    20/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    20

    SummarySummary

  • 8/9/2019 14 Other Schduling Models

    21/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    21

    We learntWe learnt

    EDF

    Rate Monotonic Scheduling using higher

    rate of events occurrence First precedence

    Fixed Times Scheduling: Simulatedannealing, Heuristic and Dynamic

    programming

  • 8/9/2019 14 Other Schduling Models

    22/22

    2008Chapter-8 L22: "Embedded Systems - Architecture,

    Programming and Design" , Raj Kamal, Publs.: McGraw-Hill,

    Inc.

    22

    End of Lesson 22 of Chapter 8End of Lesson 22 of Chapter 8