Realtime Scheduling

Task Scheduling

We are deploying multiple tasks.

Hmmm..How do we shedule the tasks? Lets start with some naive approaches.

Earliest deadline scheduling (EDS)

--Starting deadline -Completion deadline --Dynamic priority scheduling Parameters: ready time, starting deadline, completion deadline, processing time, resource requirement, priority, preemptive or non-preemptive
Lets look at an example: See sidebar
Lets examine (i) FCFS (ii) A has priority (iii) Earliest deadline first (EDF)

Aperiodic Task Set

See side bar. You have proir knowledge of the task times. Use earliest deadline with unforced idle time.

Rate monotonic scheduling (RMS)

Periodic tasks are prioritized by the frequency of repetition (high priority to tasks with shorter periods)
Preemptive scheduling is commonly used.
Schedulability according to RMS Σ(Ci/Ti) <= n(pow(2,1/n)-1)
Cyclic executives (pre-scheduled)

Clock-driven scheduling

Consider a set of N period tasks. Your goal is to design a cyclic executive for the N tasks. A periodic task is denoted by {tai, ei ,pi, Di} where the attributes are arrival time, execution time, period and relative deadline for task i For example {0, 5, 12, 7} means


How will the timing diagram be for {1, 5, 12, 7} and for {0, 5,12, 12}? Lets discuss.

Problem Statement: n periodic tasks with {tai, ei ,pi, Di} with i = 1..n need to be scheduled. Since the four parameters known ahead the scheduling is static and a cyclic executive can be designed to schedule (& execute) the tasks so that they meet their respective deadlines.

Rules for designing a cyclic executive

  1. Utilization U = ∑ (ei/pi) if utilization U>1, the tasks cannot be scheduled in the same processor.
  2. If U is okay, Hyperperiod H is lcm (pi) + these constraints
    • Frame f ≥ max(ei)
    • Frame f should evenly divide H.
    • There should be at least 1 frame between release time of a task and its deadline: 2f – gcd(pi,f) ≤ Di
    Very often Di and Pi are same for periodic task. We will assume this simplification.

Example: Given the task set on the sidebar design the cyclic executive schedule or clock driven static schedule.