Scheduling Flashcards

1
Q

Why is scheduling relevant to the OS?

A

Kernel decides which process gets to run

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

What is the job of the scheduler?

A

Maximise utilisation of the CPU by swapping processes when it stops doing useful work

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

Why bother?

A

By interleaving execution when the process is idle, we can maximise CPU utilisation and reduce the time taken for jobs to finish.

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

What is a CPU scheduler?

A

CPU becomes idle, choose process to execute from the ready queue

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

What states can process be in?

A

Ready
Running
Blocked
Terminated

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

What is nonpreemptive scheduling?

A

Processes give up the CPU voluntarily (Co-operative)

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

What is preemptive scheduling?

A

Allows scheduling at any point

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

Why is concurrency control needed when scheduling?

A

Accessed shared application state may be left inconsistent. Requires coordination of access to shared state

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

When are processes preempted?

A

Only on IO block/after completion of system call as OS or Driver data structures may be left partially updated.

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

How is scheduling evaluated?

A

CPU Utilisation

Throughput

Turnaround time

Waiting time

Response time

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

Describe what is meant by CPU Utilisation.

A

Percentage of time for which CPU is busy.

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

Describe what is meant by Throughput.

A

Number of processes completed in a given time.

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

Describe what is meant by Turnaround time.

A

Time from submission of process to its completion

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

Describe what is meant by Waiting time.

A

Total time in the ready queue

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

Describe what is meant by Response time

A

Time from submission of process to time of first response.

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

What does the dispatcher do?

A

Switches from one task to another.

Performs needed tasks:

  • switch context
  • switch to user mode
  • jump to proper location
17
Q

What is FCFS?

A

First Come First Served.

FIFO ready queue. Ready processes added to the end of the queue., process at head allocated to CPU when available

18
Q

What determines the average wait time of a FCFS queue?

A

Arrival order.

19
Q

When is FCFS not good?

A

When there is overlap in execution of IO devices and CPU.

20
Q

What does the SJF algorithm do?

A

Assign CPU to process with shortest next burst (impossible to implement as can’t predict the future).

Make best approximation as to how long burst will be.

21
Q

How does priority scheduling work?

A

Assign a priority to each process, CPU is allocated to process with highest priority.

Potential problem of starvation of low priority processes, introduce ageing scheme

22
Q

How is the priority of a process determined?

A

Internal measures; Memory requirements, CPU/IO burst ratio, System vs. user process

External measures; User-set priority, which use is running it

23
Q

How is Round Robin scheduling implemented?

A

Set a time, quantum, as the maximum burst time. Use the FIFO queue and allow to run for the quantum

24
Q

What are multi-level queues?

A

Used when processes can be easily classified into groups.

Partition the ready queue into several separate queues and reassign processes into these queues.

25
Q

What is a multi-level feedback queue?

A

Extension of ML queue, allows processes to move between queues. Queues are separated according to CPU burst characteristics.

26
Q

What is the algorithm of a feedback queue?

A

High priority processes in top queue.

If process exceed its quantum, move to a lower queue.

CPU bound processes sink, IO-bound have priority.

If processes waits for a long time, move to a higher queue