OS5 Flashcards

(22 cards)

1
Q

Describe first come first serve.

A

Schedule depends purely on the order which processes arrive.

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

State the convoy effect.

A

In first come first serve, short-running processes can get stuck behind long-running processes.

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

Describe shortest job first.

A

Estimate length of next CPU burst for each process. Schedule the process with the shortest next burst.

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

State the optimality of shortest job first.

A

It gives the least possible waiting time for a given set of processes.

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

Describe shortest remaining time first.

A

It is a pre-emptive version of shortest job first - reschedules processes when a new one arrives.

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

Why is shortest remaining time first not optimal?

A

Because context switches are not free.

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

State the assumption used when predicting burst lengths.

A

The next burst will not be too different from the previous.

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

State the method of predicting burst lengths.

A

Exponential averaging. $$\tau_{n+1}=\alpha t_n + (1-\alpha)\tau_n$$ where $t_n$ is the actual time and $\tau_n$ is the estimated time.

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

When is exponential average accurate?

A

If the variance is small.

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

Describe round robin.

A

Give each process a quantum of CPU time. After the quantum, the process is pre-empted.

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

State the effect of large and small quantum size in round robin.

A

$q$ too large then it is a FIFO queue. $q$ too small then too much time spent on context switches.

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

State the properties of round robin.

A

Fair: each process gets $1/n$ CPU time in chunks. Live: no process waits for more than $(n-1)q$ time.

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

Compare round robin to shortest time remaining first.

A

Higher average turnaround time. Better average response time.

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

Define priority scheduling.

A

Each process is associated with an integer priority, schedules the highest priority (lowest number) process.

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

Define starvation.

A

Starvation occurs when low priority processes never execute.

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

Describe dynamic priority scheduling.

A

The priority of a process starts from a static base, and increases as time passes without it being scheduled.

17
Q

Describe the scheduler used in UNIX.

A

Kernel processes: fixed priority, non-preemptive. User processes: dynamic priority, pre-emptive.

18
Q

State the formula for dynamic priority.

A

For process j at time interval i:
base_j : base priority
nice_j : user controlled parameter
load_j : average length of the run queue
CPU_j : the age counter

$$\begin{align}
\text{CPU}_j(i) &= \frac{2 \times \text{load}_j}{2 \times \text{load}_j + 1} \text{CPU}_j(i-1)
P_j(i) &= \text{base}_j + \frac{\text{CPU}_j(i)}{4} + 2 \times \text{nice}_j
\end{align
}$$

19
Q

Describe multilevel queues.

A

Ready queues are partitioned into many queues for different types of processes. Each queue can use a different scheduling algorithm.

20
Q

Describe multilevel queues with fixed priority.

A

Lowest priority queue is served before the other one, permits starvation.

21
Q

Describe multilevel queues with time slice/round robin.

A

Each queue gets a certain amount of CPU time.

22
Q

State the parameters of a multilevel feedback queue.

A

Number of queues and scheduling algorithm used for each queue. Methods used to determining when to upgrade/demote a process. Method to determine which queue to service.