Chapter 5 - CPU Scheduling Flashcards
what is the primary purpose of CPU scheduling?
to ensure that the computer is always working on a process (no idle time). it selects a process to run from the ready queue when the CPU goes idel
what is the CPU/IO burst cycle?
the CPU alternates between CPU and IO bound tasks, often times it alternates between the two or has several CPU bound bursts in a row
what is in the ready queue for the CPU scheduler?
PCB’s, process control blocks
under what four circumstances to CPU scheduling decisions get made?
- when a process switches from running to waiting
- when a process switches from running to ready
- when a process switches from waiting state to ready state
- when a process terminates
what is non-preemptive scheduling?
once the CPU has scheduled a process, it keeps the CPU until it releases it either by terminating or waiting
what is preemptive scheduling?
the scheduler decides when the process should be moved back into a ready state
what is the main drawback of preemptive scheduling?
it can cause race conditions if two processes share data and one is preempted for the other and the other updates the data that the first was going to update
what is the dispatcher?
the module that gives control of the CPU’s core to the process selected by the scheduler
what does the process of dispatching look like (handing off control to the process)
- switching context from one process to another
- switching to user mode
- jumping to the proper location in the user program that it was last running at
what is dispatch latency?
the time it takes for the dispastcher to stop one process and start the next
what are the 5 criterium to think about when considering CPU scheduling algorithms?
CPU Utilization, Throughput, Turnaround Time, Waiting Time, Response Time
What generally are the two things that get optimized for in scheduling algorithms?
CPU Utilization, Throughput
what is generally considered the “simplest” scheduling algorithm?
First come first served! the process that requests the CPU first is allocated the CPU first….FIFO baby
what is the drawback of FCFS?
making short processes wait behind long ones, it’s also non-preemptive
why typically has longer bursts? CPU Bound or IO Bound processes?
CPU Bound
What is the Convoy effect?
When CPU bound processes cause IO bound ones to wait