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

Post on 01-Jan-2016

216 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

Transcript

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.

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).

Scheduling levels combination

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).

First Come, First Served

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

FCFS Statistics

Round Robin (RR)

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

RR Statistics

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.

SPN example

SPN statistics

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.

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.

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.

FB schedule

FB statistics

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.

FB schedule(exponentially growing quanta)

FB statistics(exponentially growing quanta)

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 β.

SRR example

SRR statistics

Arrival process assumptions

Penalty ratios for short term scheduling

Missed time for short-term scheduling

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.

Classification of scheduling policies

top related