slides 12 - Scheduling Flashcards

1
Q

CPU scheduler

A

When CPU becomes idle, it selects next job from ready queue

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

CPU Dispatcher

A
  • Swaps processes
  • Steps:
    1. Switch context from one process to another
    2. Switch to user mode
    3. Jump to proper location in user program and resume
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Preemptive vs non-preemptive

A
  • Preemptive: running process can be interrupted
  • Non-preemptive: any new process must wait for running process to finish CPU cycle
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Preemptive vs non-preemptive examples (2 each)

A

PREEMPTIVE
1. process switches running -> ready
2. process switches waiting -> ready

NON-PREEMPTIVE
1. process switches running -> waiting
2. process terminates

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

CPU utilization

A

capacity used/total capacity

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

Efficiency

A

useful work/total work

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

Throughput

A

number of processes completed per unit time

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

Turnaround time

A

Interval from submission to completion of a process

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

Waiting time

A

Sum of periods spent in ready queue

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

Response time

A

Time from submission to time the request got the first response - start of response is taken

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

Estimating runtime of jobs (formula)

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

First-come, first-served scheduling

A
  • Jobs that arrives first is given CPU first
  • Convoy effect: if we have a lot of I/O bound processes waiting on I/O and a CPU bound process gets on the CPU first, its going to hold the CPU for a long time and the IO processes will have to wait in the ready queue for a long time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Shortest-job-first scheduling

A
  • Non-preemptive
  • Assume a set of jobs have already arrived and in ready queue
  • Select job with shortest burst size
  • Minimal average waiting time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Shortest remaining time next scheduling

A
  • Preemptive
  • Selects job with smallest REMAINING burst size
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Round-robin scheduling

A
  • Has a quantum (time slice): length before preemption of a process
  • Ready queue is a circular queue
  • If executing process has more time -> goes back to ready queue
  • If executing process terminates -> select another job
  • Benefit: fair - a job gets1/n of the CPU every q time units
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Round-robin scheduling issues

A
  • Job needs to wait at most (n-1) x q before running again
  • More jobs in queue/large quantum size -> slow jobs
  • Small quantum size -> many context switches, inefficient
  • Good quantum size = average size of job
17
Q

Priority scheduling

A
  • CPU given to process with highest priority
  • Equal priorities handled thru FCFS
  • Convention: low priority numbers = higher priority
  • Preemptive: current job evicted if higher priority process arrives
  • Nonpreemptive: ready queue sorted by priority
18
Q

Priority scheduling issues

A
  • Starvation: low priority processes blocked if high number of incoming higher priority jobs
  • Solution: aging -> gradually increasing priority of jobs not selected