Chapter 5 - CPU Scheduling Flashcards

1
Q

what is the primary purpose of CPU scheduling?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is the CPU/IO burst cycle?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is in the ready queue for the CPU scheduler?

A

PCB’s, process control blocks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

under what four circumstances to CPU scheduling decisions get made?

A
  1. when a process switches from running to waiting
  2. when a process switches from running to ready
  3. when a process switches from waiting state to ready state
  4. when a process terminates
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is non-preemptive scheduling?

A

once the CPU has scheduled a process, it keeps the CPU until it releases it either by terminating or waiting

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is preemptive scheduling?

A

the scheduler decides when the process should be moved back into a ready state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is the main drawback of preemptive scheduling?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is the dispatcher?

A

the module that gives control of the CPU’s core to the process selected by the scheduler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what does the process of dispatching look like (handing off control to the process)

A
  1. switching context from one process to another
  2. switching to user mode
  3. jumping to the proper location in the user program that it was last running at
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is dispatch latency?

A

the time it takes for the dispastcher to stop one process and start the next

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what are the 5 criterium to think about when considering CPU scheduling algorithms?

A

CPU Utilization, Throughput, Turnaround Time, Waiting Time, Response Time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What generally are the two things that get optimized for in scheduling algorithms?

A

CPU Utilization, Throughput

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is generally considered the “simplest” scheduling algorithm?

A

First come first served! the process that requests the CPU first is allocated the CPU first….FIFO baby

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is the drawback of FCFS?

A

making short processes wait behind long ones, it’s also non-preemptive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

why typically has longer bursts? CPU Bound or IO Bound processes?

A

CPU Bound

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the Convoy effect?

A

When CPU bound processes cause IO bound ones to wait

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is Shortest Job First Scheduling? SJF?

A

it prioritizes the process with the shortest CPU burst, uses FCFS in event of a tie breaker

18
Q

how does Shortest Job First estimate the length of the CPU burst of a process?

A

the scheduler users historical data from the same process and it’s essentially a weighted average to predict the next cpu burst for that process

19
Q

what is Round Robin Scheduling?

A

same as FCFS but with the ability to preempt a process to allow the system to switch between processes more easily

20
Q

how does Round Robin Scheduling work?

A

it effectively makes the CPU bursts more uniform leading to a more consistent distribution of CPU burst time

21
Q

what is Priority CPU Scheduling?

A

a more general version of the SJF. it does this by taking the inverse of the next predicted CPU burst. The higher the CPU burst, the lower the priority

22
Q

what factors may play into priority scheduling?

A

cpu average burst time, memory requirements, open files

23
Q

what interruption scheme is priority scheduling?

A

can be both preemptive and non-preemptive

24
Q

what is a major problem with Priority Scheduling?

A

a long process could be completely starved of compute time

25
Q

what is a solution to idefinite blocking or process starvation?

A

including process age in the priority algorithm

26
Q

what is multilevel queue scheduling?

A

each priority level is placed into it’s own queue

27
Q

what is asymmetric multiprocessing?

A

when one core handles all the scheduling and the other cores just execute processes

28
Q

what is symmetric multiprocessing?

A

every processor is self scheduling

29
Q

how does symmetric multiprocessing solve race conditions?

A

by having each processor have it’s own thread/process queue

30
Q

What is chip multithreading (CMT) and why is it important?

A

CMT assigns multiple hardware threads to each processing core allowing the core to switch between threads if one stalls

31
Q

what are the two main types of multithreading for processing cores?

A

course-grained (switches on long latency events) and fine-graned (switches frequently at low cost)

32
Q

How many levels of scheduling are required for a multithreaded, multicore processor and what are they?

A

two levels:
1. OS Scheduling of software threads
2. Core level scheduling of hardware threads

33
Q

how does load balancing work in a symmetric multiprocessing environment?

A

each thread queue is evenly distributed so that each core doesn’t get too many processes

34
Q

what is processor affinity

A

when a process doesn’t want to change thread queues because there is some cached data it is relying upon

35
Q

what are the two types of high level scheduling concepts for an OS?

A

soft real time and hard real time…hard real time means a process has to run critically when it’s told to run

36
Q

what is rate-monotonic scheduling?

A

uses a priority policy with preemption. lower priority processes get preempted

37
Q

what is earliest deadline firs (EDF)

A

assigns priorities according to the deadline of when the process needs to be executed by

38
Q

what is proportional share scheduling?

A

allocations proportional CPU time to processes

39
Q

what scheduler does Linux kernel use?

A

the Completely Fair Scheduler. it uses priority classes

40
Q
A