7 - Scheduling Introduction Flashcards

October 7 quiz

1
Q

What are scheduling policies also called?

A

disciplines

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

What is the workload?

A

the processes running in the system

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

What are jobs?

A

processes

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

What is the purpose of a scheduling metric?

A

lets us compare different scheduling policies

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

What is turnaround time?

type of metric

A

a scheduling and performance metric

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

What is the formula for turnaround time?

A

the time which the job completes minus the time which the job arrived in the system;
T turnaround = T completion - T arrival

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

What is another scheduling metric that is at odds with performance?

A

fairness

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

What is the most basic algorithm?

A

First-In-First-Out or First Come, First Serve

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

If all the jobs run for the same amount of time and arrive at the same time, which is the optimal algorithm?

A

FIFO, FCFS

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

If all the jobs run for different amount of time and arrive at the same time, which is the optimal algorithm?

A

Shortest Job First, SJF

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

What is the convoy effect?

A

A number of relatively-short potential consumers of a resource get queued behind a heavyweight consumer

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

Which algorithm is considered optimal?

theoretically

A

Shortest Job First

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

If all the jobs run for different amounts of time, arrive at different times, and don’t need to run to completion at once, which is the optimal algorithm?

A

Shortest Time-to-Completion First, STCF also known as Preemptive Shortest Job First, PSJF

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

How does Shortest Job First function?

A

It runs the shortest job first, then the next shortest, and so on.

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

Is SJF preemptive?

A

No, SJF is non-preemptive.

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

Using which algorithm can the scheduler preempt a job and run another job?

A

Shortest Time-to-Completion, STCF

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

How does STCF work?

A

Any time a new job enters the system, the STCF determines which of the remaining job, including the new job, has least time left, and schedules that one.

18
Q

Time-shared machines gave birth to what metric?

A

response time

18
Q

Which algorithm should be used if we knew job lengths, and that jobs only used the CPU, and our only metric was turnaround time?

A

STCF

19
Q

What is response time?

A

the time from when the job arrives in a system to the first time it is scheduled

20
Q

What is the formula for response time?

A

T response = T first run - T arrival

21
Q

What does the last job have to do in STCF?

A

it has to wait for the previous jobs to run in their entirety before being scheduled just once.

22
Q

How does Round-Robin work?

A

It runs a job for a time slice/scheduling quantum and then switches to the next job in the run queue. it repeatedly does so until the jobs are finished.

23
Q

What is Round-Robin also known as?

A

time-slicing

24
Q

What is true of the time slice in RR?

A

It must be a multiple of the timer-interrupt period.

25
Q

When programs run, in what do they build up a great deal of state?

A

CPU Caches, TLBs, branch predictors, other on-chip hardware

26
Q

What causes the CPU Caches, TLBs, branch predictors, other on-chip hardware to be flushed and new state relevant to the currently-running job to be brought in?

A

Switching to another job.

27
Q

By response time, what betters RR performance?

A

a shorter time-slice

27
Q

Why is a too short time-slice problematic?

A

the cost of context-switching will dominate overall performance

28
Q

What is the ideal size of a time slice?

A

long enough to amortize the cost of switching without making it so long that the system is not responsive.

29
Q

If the only metric was response time, which is the optimal algorithm?

A

Round-Robin

30
Q

If turnaround time was the only metric, which algorithm would be the worst?

A

Round Robin

31
Q

What does turnaround time care about?

A

when jobs finish

32
Q

What are the two schedulers? What do they optimize and do bad?

A

SJF,STCF & RR.
SJF,STCF optimizes turnaround time but does bad for response time
RR optimizes response time but does bad for turnaround time

33
Q

Why won’t the currently-running job be using the CPU during the I/O?

A

It is blocked waiting for I/O to be done.

34
Q

When a job requests I/O, what can a scheduler do?

A

probably schedule another job on the CPU at that time.

35
Q

Usually, the OS knows how much about the length of each job?

A

very little

36
Q

What happens when the I/O request is completed?

A

An interrupt is raised, and the OS runs and moves the process that requested the I/O from blocked to ready state

37
Q

What is a multi-level feedback queue?

A

a scheduler that uses the recent past to predict the future

38
Q

How can I maximize the utilization of systems?

A

by overlapping operations

39
Q

When is overlap used?

A

performing disk I/O, sending messages to remote machines

40
Q

What is amortization?

A

By performing the operation fewer times, the total cost to the system is reduced.