Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS250 OPERATING SYSTEMS Chapter 6 - CPU Scheduling Basic Concepts The objective of multi-programming is have a program running at all times Maximize.

Similar presentations


Presentation on theme: "CIS250 OPERATING SYSTEMS Chapter 6 - CPU Scheduling Basic Concepts The objective of multi-programming is have a program running at all times Maximize."— Presentation transcript:

1

2 CIS250 OPERATING SYSTEMS

3 Chapter 6 - CPU Scheduling Basic Concepts The objective of multi-programming is have a program running at all times Maximize CPU utilization A process executes until it has to wait for something: O/S takes the CPU away and gives it to another process CPU scheduler is central to O/S design

4 CPU-I/O Burst Cycle Process CPU, wait… Last instruction, terminate, CPU > short CPU bursts < long CPU bursts

5 CPU Scheduler Short-term scheduler - when the CPU is idle, a process is selected

6 Preemptive Scheduling The process scheduler interrupts a process and transfers the CPU to another process –switch from run to ready –switch from wait to ready

7 Non-Preemptive No interrupts; once a process has the CPU, it runs until there is an I/O interrupt or the process terminates No choice; the process keeps CPU until it releases it –process switches from running to wait –process terminates No timer is required

8 Dispatcher Gives the control of the CPU to a selected process: –switch context –switch to user mode –jump to a location in the user program and restart Should be fast; the time to stop one process and start another is called dispatch latency

9 Scheduling Criteria Algorithms are used to schedule the CPU time Consider the properties for each algorithm –CPU utilization –throughput –turnaround time –waiting time –response time

10 Scheduling Criteria CPU Utilization - keep the CPU busy as much as possible; utilize as close to 100%; realistic - 40-90% Throughput - the number of processes that complete in a given time; a measurement of the amount of work being done –10 processes per second

11 Scheduling Criteria Turnaround Time - how long it takes for a process to run; subtract time of completion from submission start time –wait states are included in this time Waiting Time - total amount of time a process spends in the ready queue Response Time - amount of time it takes to get a response

12 Maximize CPU and throughput Minimize turnaround, wait and response time

13 Scheduling Algorithms A method for deciding which process in the ready queue should be allocated the CPU

14 Scheduling Algorithms First-Come, First-Served - non-preemptive; the first process to request the CPU, gets it –uses FIFO queue: PCB is linked to the tail of the queue; the head gets allocated CPU Shortest-Job-First - shortest CPU burst first; if there is a tie, uses FIFO

15 Scheduling Algorithms Priority Round-Robin

16 Scheduling Algorithms Multilevel Queue Multilevel Feedback Queue

17 Other Scheduling Models Multi-Processor Scheduling Real-Time Scheduling

18 Algorithm Evaluation Deterministic modeling Queuing models Simulations Implementation


Download ppt "CIS250 OPERATING SYSTEMS Chapter 6 - CPU Scheduling Basic Concepts The objective of multi-programming is have a program running at all times Maximize."

Similar presentations


Ads by Google