Академический Документы
Профессиональный Документы
Культура Документы
24-Apr-14
Subtitled
Outline
Scheduling & Resource Management Approaches to Scheduling (RTS)
Clock-Driven Scheduling Round-Robin Scheduling Priority Scheduling Static versus Dynamic Systems & Scheduling
the allocation and coordination of the system (passive) resources to jobs is defined by the resource access-control protocols the module which implements these algorithms and protocols
Dr. Alain Beaulieu Scheduling & Schedulers- 7
24-Apr-14
** depends on algorithm
Scheduling & Schedulers- 7
Optimal algorithms
finding feasible schedules is not always easy an algorithm which always produces a feasible schedule, if one exists, is said to be optimal
What does this say about a set of jobs which cannot be scheduled by an optimal algorithm?
24-Apr-14
message handlers
Approaches to Scheduling
There are generally three broad classes, or approaches to processor scheduling:
Clock-driven scheduling Round-robin scheduling Priority scheduling
Clock-Driven Scheduling
At pre-specified time instants, a job or sequence of jobs are scheduled onto the processor(s)
job/task scheduling is designed off-line all system job parameters are known a priori and are fixed scheduling overhead is minimal may be implemented using a hardware timer mechanism illustrate by way of example on the board
24-Apr-14
Timer-Driven Scheduling
Observe the schedule below for this system: {T1= (4,1) , T2= (5,1.5), T3 = (20,1) , T4 = (20,2)}
slack time (space for asynchronous jobs)
hyperperiod, H = 20
T1 T2 T3 T1 T2 0 2 4 6
T1 T4 8 10
T1 T2 12 14
T1 T2 16 18
T1 20
...
22 24
Timer-Driven Scheduling
Rather than making scheduling decisions at arbitrary times, limit decision making to specific points in the hyperperiod, at frame boundaries
scheduling decision points frame size, f = 4 T1 T2 T3 T1 T2 0 2 4 6 T1 T4 8 10 T1 T2 12 14 T1 T2 16 18 20 22
hyperperiod, H = 20
...
24
Round-Robin Scheduling
In straight round robin scheduling,
ready jobs are inserted in a FIFO queue and when they reach the front of the queue they are given an equal slice of processor time jobs are preempted at the end of their slice regardless of completion status therefore in an n job system, each job gets 1/n th of the processor typically processor time slices are quite short with respect to execution times
24-Apr-14
Example:
Priority-Driven Scheduling
In a priority-driven system, ready jobs are assigned to processors according to their relative priorities
also called greedy scheduling or list scheduling priorities may be static or dynamic jobs may be preemptable or nonpreemptable
in general preemptive scheduling feels intuitively better than nonpreemptive but there are exceptions
24-Apr-14
The Periodic Task Model The periodic task model is a classical workload model of real-time systems; one which we will study further in this course
the underlying assumption is that each regular or semi-regular function of the system be modeled as a periodic task each periodic task (Ti) is defined by its period (pi) and its worst-case execution time (ei) a tasks period is defined as the minimum length of all time intervals between release times of consecutive jobs
24-Apr-14
The Periodic Task Model The accuracy of the model is dictated by how closely it resembles the system under study
it is quite accurate when the release time jitter is small (best when all tasks are truly periodic) and when the execution times of tasks are well known and have small deviations conversely the accuracy of the model degrades if the release time jitters are high and/or the execution times have high variance
24-Apr-14
the hyperperiod (H) of a set of periodic tasks is defined by their least common multiple the amount of time a task keeps the processor busy is known as utilization
ui = ei / pi given tasks with periods of 3, 8 & 12 H = 24 and the maximum # of jobs N = 8 +3 +2 = 13
24-Apr-14
The Periodic Task Model Often we assume that within each task a job releases at the beginning of the period and that it need only complete by the end of the period More generally, Di can be any value
-> default deadline is equal to the period (Di = pi )
we can model job precedence in terms of release times and deadlines example: r1,1= 0, d1,1= 3, r1,2= 3, d1,2= 7 -> J1,1 < J1,2 How can we use deadline to minimize response jitter?
24-Apr-14
24-Apr-14
24-Apr-14
24-Apr-14
24-Apr-14
24-Apr-14
Question
What about system overhead times such as context switching?
24-Apr-14
References
[1] Liu, J.W.S., Real-Time Systems, PrenticeHall, 2000. [2] Labrosse, J.J., MicroC/OS-II 1st and 2nd Editions (1999, 2002)
24-Apr-14