classification of scheduling policies preemptive methods (typical representative: rr) non-preemptive...

27
Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption reasons: Service interrupted by various external events (e.g., clock interrupt, new arrivals in the ready queue and changes of priority within that queue). • Once decided to start another process, the policy that selects the new process makes a priority decision: The most urgent process should run next.

Upload: irene-fitzgerald

Post on 01-Jan-2016

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Classification of scheduling policies

• Preemptive methods (typical representative: RR)• Non-preemptive methods (typical representative: FCFS)

• Preemption reasons: Service interrupted by various external events (e.g., clock interrupt, new arrivals in the ready queue and changes of priority within that queue).• Once decided to start another process, the policy that selects the new process makes a priority decision: The most urgent process should run next.

Page 2: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Classes of Scheduling

• Scheduling: Time Management

• Long term scheduling: which jobs (or job steps) to run next.

• Medium term scheduling: which running processes to block as resources are overcommitted or because a resource request cannot be served at the time.

• Short-term scheduling: decides how to share the computer among all processes that currently want to perform some computation (typically tens of times each second).

Page 3: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Scheduling levels combination

Page 4: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Interactive processes

• Should be given special attention.

• Users need to see immediate reaction to their commands.

• Typically stay within the short scheduler’s control for very limited time.

• I/O bound processes also spend a lot of time getting data from devices or files (e.g., COBOL).

Page 5: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

First Come, First Served

Non pre-emptive policyNever leaves the domain of the short-term scheduler

Page 6: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

FCFS Statistics

Page 7: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Round Robin (RR)

q: quantumnew arrivals added at the end of the queueq>largest service time: FCFSq~0: Processor Sharing

Page 8: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

RR Statistics

Page 9: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Shortest Process Next (SPN)

SPN is an attempt to improve the response rate for short processes (alike RR) but without pre-emption.

SPN requires explicit information about the service-time reqs of a process.

Problem: collection of time req estimates.

Solution: low pass filter calculation of the average, exponentially distributed service time.

Page 10: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

SPN example

Page 11: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

SPN statistics

Page 12: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Pre-emptive shortest process next

• Combination of RR and SPN

• PSPN preempts the current process when another process arrives with a total service time req less than the remaining service time of the current process.

• PSPN gives the best possible average penalty ratio because it keeps the ready list as short as possible.

Page 13: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Highest penalty ratio next (HPRN)

Non pre-emptive scheme.

When some process departs from the CPU, the ready process with the highest penalty ratio is selected for execution.

Penalty ratio = T/t, T: time that process is present/visible to the short term scheduler (includes execution time), t: execution time.

T: finish time-arrival time.

Problem: estimation of t.

Page 14: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Multiple-level feedback (FB)

Ready list split into a number of queues: 0, 1, 2, ….

Lower-numbered queues have high priority.

When a process is interrupted a new one is selected from the lowest numbered queue that has processes.

After a process has consumed some quanta, it is placed at the end of the next-higher numbered queue.

Page 15: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

FB schedule

Page 16: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

FB statistics

Page 17: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

FB variations

Quantum size dependent on queue. Queue numbered n has a quantum size 2nq where q is a “basic size”. First queue: q, Second queue: 2q, Third queue: 4q …..

A process in queue n is schedule RR for 2n (or n) quanta and then put into another queue.

Process promoted to higher priority after spending some time waiting for service in current queue.

Page 18: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

FB schedule(exponentially growing quanta)

Page 19: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

FB statistics(exponentially growing quanta)

Page 20: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Selfish RR (SRR)

Better service to “old” processes than to newcomers.

Ready list partitioned into two lists: new and accepted.

New processes wait. Accepted processes are serviced RR.

Priority of new processes increases at rate α. Priority of accepted processes increases at rate β.

Page 21: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

SRR example

Page 22: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

SRR statistics

Page 23: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Arrival process assumptions

Page 24: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Penalty ratios for short term scheduling

Page 25: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Missed time for short-term scheduling

Page 26: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Priority information• Intrinsic properties: characteristics that distinguish one process from another. Include service-time requirements, storage needs, resources held, and the amount of I/O required. • Extrinsic properties: characteristics that have to do with the user who owns the process. Extrinsic properties include the urgency of the process and how much the user is willing to pay to purchase special treatment.• Dynamic properties: the load that other processes are placing on resources. Dynamic properties include the size of the ready list and the amount of main store available.

Page 27: Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption

Classification of scheduling policies