Presentation is loading. Please wait.

Presentation is loading. Please wait.

Uniprocessor Scheduling

Similar presentations


Presentation on theme: "Uniprocessor Scheduling"— Presentation transcript:

1 Uniprocessor Scheduling
Scheduling of Processes

2

3 Types of Scheduling Long-term (least frequent decision) Medium-term
When an new process is created, will it be admitted to the ready queue? Controls degree of multiprogramming (balances response/turnaround time and processor utilization) Can consider priority, expected execution time, I/O requirements, etc. Responds to requests for interactive sessions Medium-term Which processes should have frames allocated? Also affects degree of multiprogramming Already discussed in context of memory management Short-term (most frequent decision) Which process should execute next? Focus of this lesson I/O – next lesson

4 Short-Term Scheduling
Performed by part of kernel referred to as dispatcher Invoked in response to Timer interrupts I/O interrupts System calls Signals (e.g. from semaphores) Some long-term and medium-term scheduling events

5 Short-Term Scheduling Criteria
Performance Related Other User Oriented Turnaround time Response time Deadlines Predictability System Oriented Throughput Processor utilization Fairness Enforcing priorities Balancing resources

6 Short Term Scheduling Policies
Can be described in terms of Selection function Decision mode

7 Selection Function Determines which of the ready processes to execute
Example inputs: s: total service time required by the process e: time spent so far in execution w: time spent so far in system (executing and waiting) May also consider resource management or other execution characteristics of processes

8 Decision Mode Specifies times at which selection function is invoked
Nonpreemptive Selection function used only when running process Blocks for I/O Requests OS service Terminates Preemptive Selection function is used at other times Timer interrupts Process admission Selection function is used when a process blocks terminates enters the system time slice expires.

9 Process Scheduling Example

10 FCFS/FIFO Policy Nonpreemptive
Always select the process that has been in the ready queue the longest 5 10 15 20 A B C D E

11 Round Robin Policy Preemptive -- processes run for a time-slice or quantum Always select the process that has been in the ready queue the longest 5 10 15 20 A B C D E

12 Virtual Round Robin Policy
I/O-bound processes typically do not use a complete quantum Put processes with pending I/O in auxiliary queue, remember how much time remains in their time slice Give preference to processes in auxiliary queue Allow to run for remainder of time slice

13

14 Shortest Process Next Policy
Nonpreemptive Always select process with shortest estimated processing time 5 10 15 20 A B C D E

15 Shortest Remaining Time Policy
Preemptive When a new process enters the system, or when the running process leaves the running state Select process with shortest estimated remaining processing time 5 10 15 20 A B C D E

16 HRRN Policy HRRN = Highest Response Ratio Next Nonpreemptive
Always select the process that has the highest value of A B C D E 5 10 15 20

17 Multi-Level Feedback Policy
Preemptive based on time quantum Maintain a ready queue for each priority When a process is preempted, move it to a lower priority queue Note: If there are no processes waiting, don’t preempt current process With quantum = 1, long processes will have very large turnaround time Give processes from queue RQi quantum = 2i

18

19 Quantum = 1 5 10 15 20 A B C D E

20 Quantum = 2i [[[Need to redo figure]]]


Download ppt "Uniprocessor Scheduling"

Similar presentations


Ads by Google