Multiple – Processor Scheduling
Multiple – Processor Scheduling
• Push migration:
• Push migration involves a separate process that runs
periodically(e.g every 200 ms) and moves processes
from heavily loaded processors onto less loaded
processors.
• Pull migration:
• Pull migration involves idle processors taking processes
from the ready queues of the other processors.
• Real time scheduling:
• Real time scheduling is generally used in the case of
multimedia operating systems. Here multiple
processes compete for the CPU. How to schedule
processes A,B,C so that each one meets its
deadlines.
• The general tendency is to make them pre-
emptable, so that a process in danger of missing its
deadline can preempt another process.
• When this process sends its frame, the preempted
process can continue from where it had left off. Here
throughput is not so significant. Important is that
tasks start and end as per their deadlines.
RATE MONOTONIC (RM) SCHEDULING
ALGORITHM
• Limitations of RM Scheduling:
• Not optimal for all task sets – Some task sets may not be schedulable with
RM even if they are with EDF.
• High-priority tasks can starve low-priority tasks if CPU utilization is high.
• Fixed priorities – Cannot adapt to changing system conditions dynamically.
Earliest Deadline First (EDF) Scheduler
Algorithm
• The EDF is a dynamic algorithm, Job priorities
are re-evaluated at every decision point, this
re- evaluation is based on relative deadline of
a job or task, the closer to the deadline, the
higher the priority.
The EDF has the following advantages:
• Very flexible (arrival times and deadlines do not
need to be known before implementation).
• Moderate complexity.
• Able to handle a periodic jobs.
The EDF has the following disadvantages:
• Optimally requires pre-emptive jobs.
• Not optimal on several processors.
• Difficult to verify.
Example
• Consider the following task set in Table 1. P
represents the Period, e the Execution time
and D stands for the Deadline. Assume that
the job priorities are re-evaluated at the
release and deadline of a job.
• Consider three processes with the following properties:
• Process Arrival Time Execution Time Deadline
• P1 0 ms 3 ms 7 ms
• P2 2 ms 1 ms 4 ms
• P3 4 ms 2 ms 6 ms
• Step-by-Step Execution:
• At time = 0 ms: Only P1 is available, so it starts execution.
• At time = 2 ms: P2 arrives with a deadline of 4 ms (earlier than
P1's 7 ms). So, P1 is preempted, and P2 starts execution.
• At time = 3 ms: P2 completes, and P1 resumes execution.
• At time = 4 ms: P3 arrives with a deadline of 6 ms, but since P1
has an earlier deadline (7 ms), P1 continues.
• At time = 6 ms: P1 completes, and P3 starts execution.
• At time = 8 ms: P3 completes execution.
• Gantt Chart Representation:
• | P1 | P2 | P1 | P3 |
• 0 2 3 6 8
• P1 runs from 0-2 ms (until P2 arrives).
• P2 runs from 2-3 ms (has the earliest deadline).
• P1 resumes from 3-6 ms (finishes execution).
• P3 runs from 6-8 ms (only process left).