Lecture 5: CPU Scheduling Flashcards

1
Q

define CPU scheduling

A

select processes from ready state, and allocate the CPU to them

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

nonpreemptive scheduling

A

take place when a process:
- switch from running to waiting state
- terminate

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

preemptive scheduling

A

take place when a process:
- switch from running to ready state
- switch from waiting to ready state

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

nonpreemptive vs preemptive scheduling

A
  • Preemptive scheduling allows a running process to be interrupted by a high priority process
  • in non-preemptive scheduling, any new process has to wait until the running process finishes its CPU cycle.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

3 tasks involve in dispatcher module

A
  • switching context
  • switching to user mode
  • jumping to proper location to restart program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

define dispatch latency

A

time taken for dispatcher to stop a process and start a new running process

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

5 scheduling criteria

A
  • CPU utilization: keep CPU as busy as possible
  • throughput: number of process completed per time unit
  • turnaround time: amount of time to complete a process
  • waiting time: amount of time of a process waiting in ready queue
  • response time: time taken from the request submitted until the first response (not output)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

convoy effect

A

short process behind long process, causing many short process get blocked
- one CPU bound and many I/O bound process

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

ready queue is separated into 2 queues

A
  • background (batch) using FCFS
  • foreground (interactive) using RR
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

problem of priority scheduling

A

starvation
- process with long burst time will never execute

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

solution of starvation

A

aging
- priority of process increase by the time progress

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

formula for AWT (average waiting time)

A

turnaround time = finished time - arrived time
waiting time = turnaround time - burst time

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

multilevel feedback queue

A

process can move between various queue

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

parameters in multilevel feedback queue

A
  • number of queue
  • scheduling algorithm for each queue
  • method determined when to upgrade a process
  • method determined when to demote a process
  • method determined which queue the process will enter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

2 processor affinity

A

soft affinity - process has policy to attempt to keep running in the same processor
hard affinity - process can specify the subset of processor to run in

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

multiprocessor core

A

multiple processor core in one physical chip

17
Q

benefits of multiprocessor core

A
  • faster
  • less power consumed
18
Q

Little’s law

A

in steady state, processes leaving queue must equal to arriving queue

  • n = l x W
    where,
    n = average queue length
    l = average waiting time in queue
    W = average arrival time in queue
19
Q

differentiate FCFS, RR and Multilevel Feedback Queue

A

First Come First Serve Scheduling
- no discriminate
- no matter short or long process
- based on arrival time

Round Robin Scheduling
- short process finish early
- shorter waiting time

Multilevel Feedback Queue
- try to complete short process first
- long process wait at queue, short process finish early

20
Q

benefits of RR

A

implement time quantum (q) in milliseconds
- no starvation
- better response (but higher turnaround than SJF)
- suitable for time-sharing system

21
Q

all scheduling method

A
  • first come first serve (FCFS)
  • preemptive SJF
  • non-preemptive SJF
  • priority scheduling
  • round robin (RR)