ch5 - Chapter 5 CPU Scheduling Chapter Chapter 5 CPU...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling
Image of page 1

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

View Full Document Right Arrow Icon
5.2 Silberschatz, Galvin and Gagne ©2005 th Chapter 5: CPU Scheduling Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples Java Thread Scheduling Algorithm Evaluation
Image of page 2
5.3 Silberschatz, Galvin and Gagne ©2005 th Basic Concepts Basic Concepts Maximum CPU utilization obtained with multiprogramming. Every time one process has to wait, another process can take over the CPU CPU–I/O Burst Cycle – Process execution consists of a cycle of CPU execution and I/O wait CPU burst distribution With a large number of short CPU bursts and a small number of long CPU bursts An I/O bound program typically has many short CPU bursts A CPU bound program might have a few long CPU bursts
Image of page 3

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

View Full Document Right Arrow Icon
5.4 Silberschatz, Galvin and Gagne ©2005 th Alternating Sequence of CPU And I/O Bursts Alternating Sequence of CPU And I/O Bursts
Image of page 4
5.5 Silberschatz, Galvin and Gagne ©2005 th Histogram of CPU-burst Times Histogram of CPU-burst Times
Image of page 5

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

View Full Document Right Arrow Icon
5.6 Silberschatz, Galvin and Gagne ©2005 th CPU Scheduler CPU Scheduler Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them. The records in the queues are process control blocks (PCBs). CPU scheduling decisions may take place when a process: 1. Switches from running to waiting state (e.g. I/O request) 2. Switches from running to ready state (e.g. an interrupt occurs) 3. Switches from waiting to ready (e.g. completion of I/O) 4. Terminates Scheduling under 1 and 4 is nonpreemptive All other scheduling is preemptive
Image of page 6
5.7 Silberschatz, Galvin and Gagne ©2005 th CPU Scheduler CPU Scheduler Preemptive scheduling incurs a cost associated with access to shared data. We need mechanisms to coordinate access to shared data Preemption also affects the design of the OS kernel Kernel may be busy with an activity on behalf of a process. What happens if the process is preempted in the middle of changes to kernel data and the kernel needs to read or modify the same structure? Chaos. Some OSs wait either for a system call to complete or for an I/O block to take place before doing a context switch Not good for real time computing or multiprocessing The sections of code affected by interrupts must be guarded from simultaneous use. They disable interrupts at entry and reenable them at exit.
Image of page 7

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

View Full Document Right Arrow Icon
5.8 Silberschatz, Galvin and Gagne ©2005 th Dispatcher Dispatcher Dispatcher module gives control of the CPU to the process selected by the short-term scheduler; this involves: switching context switching to user mode jumping to the proper location in the user program to restart that program Dispatch latency – time it takes for the dispatcher to stop one process and start another running The dispatcher should be as fast as possible
Image of page 8
5.9 Silberschatz, Galvin and Gagne ©2005 th Scheduling Criteria
Image of page 9

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

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern