chapter 4 Flashcards

1
Q

there are 3 types of scheduling levels

A

1- short-term
2- medium-term
3- long-term

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

short-term scheduling

A

scheduler decides on which process should be executed next, this level is very short time wise (micro to milliseconds). This is also known as CPU scheduling, selects process from ready queue to be executed next.

It has 3 states: READY, BLOCKED and RUNNING

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

medium-term scheduling

A

this involves swapping in and out processes from mem, this level is medium time wise (milliseconds to mins). A process is swapped out if its entire @ space is moved to secondary mem to free up physical mem for other processes.

There are 2 states: READY SUSPEND (ausgelagert bereit) and BLOCKED suspend (ausgelagert blockiert)

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

long-term scheduling

A

decisions such as which process should be admitted to the system for processing, this takes from minutes up to hours. The purpose here is control the degree of multiprogramming.

There are 2 types: NEW (erzeugt) and EXIT (beendet).

NEW (erzeugt) means that the process is ready for program processing, this state is reached when a process is created via fork(2)

EXIT (beendet) is when a state is terminated, reached by wait(2) or exit(2), the system must release all resources

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

CPU scheduling strategy - First come first served (FCFS)

A

processes are executed in the order they arrive in the ready queue.

FCFS is non-preemptive!!!

Advantage: minimizes the # of context switches since it is non-preemptive, which reduces overhead.

Disadvantage: convoy effect

FCFS is typically used for batch processing systems.

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

The Convoy Effect

A

is when short running I/O heavy processes are forced to wait behind CPU-heavy processes. This could happend in FCFS which is not wanted.

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

CPU scheduling strategy - Round Robin (RR)

A

helps mitigate the convoy effect. It divides CPU time into slices (Zeitscheiben). When the time slice is used, the process is interrupted and the process is moved to the end of the ready list and the next process is selected according to FCFS.

If the time slice is too long, RR becomes like FCFS. If it is too short, high overhead due to context switches

Time slice should be slightly longer than the typical duration of a process`s interaction with the CPU.

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

what are I/O operations?

A

interaction of a computer with the systems disk or network, such as reading/writing to disk

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

CPU scheduling strategy - Virtual Round Robin (VRR)

A

since there is an uneven CPU time distribution in RR because of CPU-heavy and I/O-heavy processes, VRR uses 2 lists:
- preferred list: processes that have just completed an I/O burst are placed here
- ready list: the normal ready list

the scheduler always starts with the preferred list first!!! VRR works with variable length time slices, processes in the preferred list are not allocated a full time slice, instead they get the remaining time from their previous incomplete time slice. If it needs more time, it is preempted and moved to the ready list.

VRR has more overhead.

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

CPU scheduling strategy - Shortest Process Next (SPN)

A

prioritises shortest processes first, the scheduler must know or estimate the CPU burst time of the processes.

SPN is non-preemptive!!

The main problem is estimating the CPU burst time.

One major downside is the risk of starvation of CPU-heavy processes as shorter processes are continiously prioritised. (there is a formula, go back to it)

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

CPU scheduling strategy - Highest Response Ratio Next (HRRN)

A

aims to prevent the starvation of CPU-heavy processes by considering both waiting time and the expected service time of processes. (formula)

The process with highest response ratio is chosen next to be executed, this ensures that a process that has been waiting for too long is chosen and given priority

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

CPU scheduling strategy - Multilevel Feedback Queues (MLFQ)

A

prioritises short processes without estimating CPU burst time. Processes with long execution time are punished by being moved to lower-priority queues.

Preemption is possible!!

The system has many different priority queues. When a process first arrives, it starts at the highest-priority queue, if it doesnt finish within time slice, it is moved to a lower-priority queue. The lowest-priority queue operates using RR.

The system can implement an anti-aging mechanism where processes that have waited too long can regain higher-priority queues to prevent starvation.

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

Priority Inversion

A

occurs when a lower-priority process is running and holding a resource while a higher-priority process is blocked waiting for said resource.

Solution: non-blocking synchro

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

Goals of scheduling from user perspective

A
  • processing time
  • response time
  • deadline adherence
  • predictability: processes are all handled similarly regardless of the load
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Goals of scheduling from system perspective

A
  • throughput: process as many processes as possible
  • CPU utilisation
  • fairness: avoid starvation
  • load balancing: I/O devices should be evenly utilised
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

at the end of lecture, there is a img with summary, check it out

A