Chapter_3_-_Scheduling

Chapter_3_-_Scheduling - 3 Scheduling 3.1 Uniprocessor...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
3 Scheduling 3.1 Uniprocessor Scheduling Further reading: Stallings Chapter 9 Silberschatz Chapter 5 Tanenbaum Chapter 2.4
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Three level scheduling 2 3.1 Uniprocessor Scheduling
Background image of page 2
Scheduling and Process Transitions 3 3.1 Uniprocessor Scheduling
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Long- and Medium-Term Schedulers Long-term scheduler Determines which programs are admitted to the system – i.e. to become processes requests can be denied – e.g. in case of thrashing or overload Medium-term scheduler decides when/which processes to suspend/resume Both control the degree of multiprogramming More processes, smaller percentage of time each process is executed 4 3.1 Uniprocessor Scheduling
Background image of page 4
Short-Term Scheduler • Decides which process will be dispatched – invoked upon Clock interrupts, I/O interrupts, Operating system calls, Signals Dispatch latency : period of time the dispatcher needs to stop one process and start another running • dominating factors: – switching context – selecting a process to dispatch Arrival time : Time when a process is assigned to the CPU Service Time : Period of time a process executes in Running state 5 3.1 Uniprocessor Scheduling
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CPU–I/O Burst Cycle • Process execution consists of a cycle of – CPU execution and –I /O wa i t . • A process may be CPU-bound : long CPU bursts IO-bound : short CPU bursts 6 3.1 Uniprocessor Scheduling
Background image of page 6
Scheduling Criteria and Optimization goals CPU utilization – keep CPU as busy as possible Throughput – # of processes that complete their execution per time unit Response time – amount of time from submission of the request until first response execution + waiting time in ready queue Turnaround time – amount of time to execute a particular process execution + all the waiting involves also the IO schedulers Fairness – watch priorities, avoid starvation, . .. Scheduler Efficiency overhead – e.g. context switching, computing priorities, … 7 3.1 Uniprocessor Scheduling
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Decision Mode Nonpreemptive • Once a process is in the running state, it will continue until it terminates or blocks itself for I/O Preemptive • Currently running process may be interrupted and moved to the Ready state by the operating system • Allows for better service since one process cannot monopolize the processor for very long 8 3.1 Uniprocessor Scheduling
Background image of page 8
First-Come-First-Served (FCFS) non-preemptive Favors CPU-bound processes A short process may have to wait very long before it can execute ( convoy effect ) 0 5 10 15 20 A B C E D 9 3.1 Uniprocessor Scheduling
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Round-Robin 0 5 10 15 20 A B C D E preemption based on clock (interrupts on time slice or quantum -q- usually 10-100 msec) fairness : for n processes, each gets 1/n of the CPU time in chunks of at most q time units Performance qlarge FIFO q small overhead can be high due to context switches 10 3.1 Uniprocessor Scheduling
Background image of page 10
Dispatcher Performance: Round Robin and FCFS • Maintain linked list – Dequeue: Remove head – Enqueue: Append tail •C o s t – Enqueue: O(1) – Dequeue: O(1) pn p1 11 3.1 Uniprocessor Scheduling
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 64

Chapter_3_-_Scheduling - 3 Scheduling 3.1 Uniprocessor...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online