1 / 10

CPU Scheduling

CPU Scheduling. CSCI 4534. Introduction. By switching the CPU among processes, the O.S. can make the system more productive Some process is running at all times Several processes are kept in memory A process is executed until it must wait typically for I/O

Download Presentation

CPU Scheduling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CPU Scheduling CSCI 4534

  2. Introduction • By switching the CPU among processes, the O.S. can make the system more productive • Some process is running at all times • Several processes are kept in memory • A process is executed until it must wait • typically for I/O • When this process waits, another runs • running means the CPU is executing it

  3. CPU-I/O Burst Cycle • Observed Property of Processes: • Processesalternate between a cycle of CPU execution and I/O wait • CPU burst • I/O burst (read from file/write to file) • CPU burst • … • CPU burst (to terminate)

  4. CPU-I/O Burst Cycle • Durations of CPU bursts vary, but curve is similar to Figure 5.2 histogram, typically: • large number of short CPU bursts • small number of long CPU bursts • I/O bound programs have many short CPU bursts • CPU bound programs have a few long CPU bursts

  5. CPU Scheduler • When CPU is idle, the O.S. selects a process in the ready queue • Done by short-term scheduler / CPU scheduler • Ready Queue is set of PCBs in: • FIFO queue • priority queue (actually a Ready State, not queue) • tree • unordered linked list

  6. CPU Scheduling Decisions • CPU scheduling decisions are made when: • A process switches from running to waiting • A process switches from running to ready • A process switches from waiting to ready • A process terminates • What is preemptive? • What are problems? • What is nonpreemptive?

  7. Dispatcher • The dispatcher gives control of CPU to the process selected by short-term scheduler • It does context switching • It switches to user mode • It jumps to next executable statement in the user program • The time taken to stop one process and start another is dispatch latency • “interval between stimulation and response”

  8. Scheduling Criteria • CPU utilization • Throughput - # processes completed per time unit • Turnaround time - time from submission to completion • Waiting time - in the ready queue • Response time - time from submission to first response

  9. Scheduling Criteria • Goals: • Maximize: CPU Utilization and Throughput • Minimize: Turnaround, Waiting and Response Times • May also want to minimize variance for response time for more predictability

  10. Scheduling Algorithms • FCFS • SJF • Priority Scheduling • Round-Robin • Multilevel Queue • Multilevel Feedback Queue

More Related