Lecture 6 - Scheduling Flashcards

1
Q

Why do processes require scheduling?

A

Bursts of CPU usage alternate with I/O wait

Some processes CPU-bound, others I/O bound

Prevent one program blocking others from executing

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

What is the Job queue?

A

Set of all the processes in the system

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

What is the ready queue?

A

Set of all processes in memory, ready to execute

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

What are device queues?

A

Sets of processes waiting for an I/O device

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

What are the goals of scheduling for all systems?

A

Fairness: give each process a fair share of the CPU

Enforcement: ensure the stated policy is carried out

Balance: keep all parts of the system busy

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

What are the goals of scheduling for batch systems?

A

Throughput - maximise jobs per unit time

Turnaround time: minimize wait time for jobs

CPU Utilisation: keep CPU as busy as possible

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

What are the goals of scheduling for interactive systems?

A

Response time: respond quickly to user’s requests

Proportionality: meet user’s expectations

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

What are the goals of scheduling for real time systems?

A

Meet deadlines - missing deadlines is a system failure

Predictability - same type of behaviour for each time slice

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

What is the difference between long term, medium term and short term schedulers?

A

Long term - selects which processes should be brought into ready queue, invoked infrequently (seconds or minutes), slow, controls degree of multiprogramming

Medium term scheduler - swaps out processes temporarily, controls number of jobs in memory, balances load for better throughput

Short term - selects which process should execute next and allocates CPU, fast

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

What is the difference between cooperative and pre-emptive scheduling?

A

Co-Operative: process runs until it drops or blocks

Pre-emptive: process interrupted by OS and moved to ready state

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

In a thread-aware operating system what does the scheduler schedule?

What must it realize to do this efficiently?

A

Threads - processes are just containers for threads

Context switch for threads from different processes is more expensive

Rescheduling threads onto a different CPU is more expensive - CPU cache might be taken by another thread’s cache

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

When does a scheduler make decisions?

A

When the current process changes state from running

Can be due to interrupt by timer

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

How does First Come First Served scheduling work?

Whats the problem with it?

A

Do jobs in the order they arrive

Very simple algorithm

BUT Some processes might have to wait if a very long job is busy executing

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

How does shortest job first scheduling work? How is it different to Shortest Time Remaining?

A

Do the shortest job first.

Shortest time remaining is a preemptive form, i.e. after interrupt check which shortest remaining job is

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

What is the problem with shortest job first scheduling?

A

How does the scheduler know how long a job has left?

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

How does Round Robin scheduling work?

A

Give each process fixed time slot,

rotate in order through ready processes,

each process makes a bit of progress

17
Q

Whats the difficulty with round robin scheduling?

A

Choosing a good quantum (timespan)

Too long - poor response

Too short - too many context switches

18
Q

How does lottery scheduling work?

A

Each process has “tickets” for cpu time

Each quantum, cpu picks a ticket at random, hence, more tickets = more likely to get cpu time

Tickets can be transferred especially between cooperating processes

19
Q

How does priority queue scheduling work?

A

Each job has priority associated with it, indicating how important it is

Highest priority jobs run first

Pre-emptive so equal priority jobs share time round robin style

20
Q

How can priority systems become significantly more flexible?

A

Allow OS to change priorities of jobs on the fly

21
Q

What is Decay-Usage scheduling?

A

Dynamic priority adjusting scheme:

waiting threads have priority increased each quantum

running threads have priority decreased each quantum

22
Q

What is multilevel queue scheduling?

A

Each queue has its own scheduling algorithm

E.g. separate system processes, interactive processes, batch, favored, unfavored processes into their own queues

23
Q

What is a real time system?

A

Where the correctness of the system depends on when the results are produced

Tasks or processes attempt to control or react to events in the outside world

e.g. control of lab experiments, robotics, air traffic control, telecommunications, military command…

24
Q

What is the difference between Hard deadlines and soft deadlines?

A

Hard: disastrous if missed

Validation essential

Soft deadline: ideally should be met, performance degrades in case of missed deadline

Best effort approaches