2. Contents
• Clock Driven Approach
• Weighted Round Robin Approach
• Priority Driven Approach
• Dynamic vs Static System
• Effective Release Time And Deadline
• Optimality and Non-eptimality of EDF and LST algorithm
• Anomalous Behavior of Priority-Driven System
2
3. Clock Driven Approach
• Also called time-driven approach . Decisions about what jobs execute are chosen
before the system begins execution.
• Parameters of the real-time jobs are fixed and known.
• Schedule of the jobs is computed off-line and is stored for use at runtime.
• Cannot handle aperiodic and sporadic task since such task cannot be predicted.
• Example: the helicopter example with an interrupt every 1/180thof a second
3
4. Weighted Round Robin
• It is Commonly used for scheduling the time shared applications.
• Jobs Join FIFO queue when becomes ready for execution.
• Each job in the queue executes for one time slice.
• If there are n jobs, then each job gets 1/n share of processor.
• Example : Jobs communicating using Unix pipes
4
5. Priority Driven
• It refers to large class of scheduling algorithm that never leave any resource idle intentionally.
• Jobs are placed in one or more queues ;at each event the ready job with highest priority is
executed.
• Also called event-driven approach.
• Computation is done online without knowing the knowledge of job that will be released in
future.
• Algorithm used in non-real time system:
– Priority driven, FIFO:-assign priority based on release time
– Shortest Execution Time First , Longest Execution Time First:-assign priority based on
execution time
5
6. Priority Driven
• Algorithm used in Real Time System:
–Earliest deadline first
–Least slack time first
• Assign priority based on deadline or some timing constriants.
6
7. EDF AND LST
• Earliest deadline first Least Slack time
7
• Assign priority to jobs based on
deadline
• Earlier the deadline, higher the priority
• the schedulability test for EDF is:
where the ei are the worst-case
computation-times of the n processes and
the Pi are their respective inter-arrival
periods.
• Assign priority to jobs based on slack time(tslack)
• Calculate Slack:
t_rem = exe_time - (time – relese_time)
t_slack = deadline - time - trem
• Smaller the slack time, the higher the priority
10. Static vs Dynamic System
Static System
10
• S Dynamic System
10
• Jobs are partitioned into subsystems, and
each subsystem is bound statically to a
processor.
• Jobs can be moved among system.
• Jobs are scheduled on multiple processors,
and a job can be dispatched from the
priority run queue to any of the processors.
• Jobs is migratable.
11. Optimality and Non-optimality of EDF and LST
algorithm
• OPTIMALITY:
11
• they will always produce a feasible schedule if one exists.
• Constraints: on a single processor, as long as preemption is allowed and jobs do not contend for resources.
• THEOREM:
• When preemption is allowed and jobs do not contend for resources, the EDF and LST algorithms can
produce a feasible schedule of a set J of jobs with arbitrary release times and deadlines on a processor if
and only if J has feasible schedules.
12. 12
Proof:
To show the optimality of EDF, we have to require to show any feasible schedule can be transformed into
another EDF schedule.
If J i is scheduled to execute before J k, but J i’s deadline is later than J k’s such that there exist two
conditions:
– The release time of J k is after the J i completes that means they’re already in EDF order.
– The release time of J k is before the end of the interval in which J i executes.
This is always possible to swap J i and J k since J i’s deadline is later than J k’s such that
13. 13
We can move any jobs following idle periods forward into the idle period then
the result is an EDF schedule
When deadline of J i’s is earlier than J k’s there is no possibility to generate the other feasible
schedule and EDF failed to produce a feasible schedule. Hence the optimality of EDF is
verified .
15. Non-optimality of EDF and LST
• EDF and LST algorithms are not optimal if preemption is not allowed or
there is more than one processor. consider j1(0,3,10),j2(2,6,14),j3(4,4,12).
15
16. 16
Consider we have two processors and three jobs J1, J2, J3, with execution
times 1, 1, 5 and deadlines 1, 2, 5 respectively. All with release time 0.
17. Effective Release Time and Deadline
• Effective release time:-
-The effective release time of a job with predecessor is equal to the maximum value
among its given release time and the effective release times of all of its predecessors.
• Effective Deadline:-
- The effective deadline of a job with successors is equal to the minimum value
among its given deadline and the effective deadline of all of its successors.
17
19. Validating Priority-Driven Scheduling
• Priority-driven scheduling has many advantages over clock-driven scheduling:
• Scheduling anomalies can occur for multiprocessor or non-preemptable systems,
or those which share resources.
19
• Easy to implement.
• Often have simple priority assignment rule,due to which run-time overhead of maintaining
queue can be small.
• Does not require information about deadline and release times in advance so it is uited to
application with varing time and resource requirement.