Lecture 8: CPU Scheduling P2 Flashcards

1
Q

Describe Shortest Job First (SJF)

A

An estimated CPU burst time is associated with each process. Scheduler uses this info to schedule shorter processes first.

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

What is the CPU burst time’s estimation based on?

A

Based on the durations of the previous bursts. (past can be a good predictor of the future)

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

Describe Priority Scheduling Algorithm

A
  • A priority number (integer) is associated with each process.
  • Higher = gets assigned CPU burst time first
  • Aging causes low priority processes to increase in priority over time to combat starvation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe Round Robin Algorithm

A
  • Each process assigned a time quantum (unit of time that represents how long they’re allowed CPU time for)
  • If there are n processes in the ready queue, then each process gets at most q time units at once
  • No process waits more than (n-1)q
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What happens when time quantum is too large?

A

You get FIFO like behaviour

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

What happens when time quantum is too small?

A

Q must be large enough, otherwise overhead is too high

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

Results of Round Robin?

A
  • Typically, higher average turnaround, but better response

- Turnaround time also depends on the size of the time quantum

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

Is SJF optimal or not widely used? Why?

A

It is optimal because it gives minimum average waiting time for a given set of processes

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

What are the two ways Multi-level Queues (without feedback) can be scheduled: ( as in scheduling the multiple queues )

A

1) Priority scheduling

2) Time Slice

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

Can a process move between queues in a:
Multi-level Queue without feedback?
Multi-level Queue with feedback?

A

No.

Yes.

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

How do processes move within a Multi-level Queue with feedback?

A

1) Moved to a lower-priority queue if process used too much CPU time
2) Moved to a higher-priority queue if process spends too much time in a lower priority queue

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