OS - CPU Scheduling

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/34

encourage image

There's no tags or description

Looks like no tags are added yet.

35 Terms

1
New cards

CPU Utilization

The percentage of time the CPU is being used.

2
New cards

Turnaround-Time

The time between the process being loaded and finishing its execution.

3
New cards

System Throughput

The number of processes completed per unit of time.

4
New cards

Waiting Time

Sum of time spent waiting in the Ready-Queue while another process is running.

5
New cards

Response Time

Amount of time between when the user does an action and when they see a response.

6
New cards

Fairness

Each process should get an equitable use of the CPU.

7
New cards

Preemptive-Scheduling Category

May interrupt the current process to dispatch the CPU to another process.:

- Interrupt-Event Driven

- Time-based

8
New cards

Non-Preemptive Scheduling Category

We wait for the current process to be done before dispatching the CPU to another process.

9
New cards

What causes starvation in CPU scheduling?

1. Infinite blocking

2. Infinite incoming processes

10
New cards

FCFS

Processes are executed in the order in which they arrive. Non-preemptive in nature

11
New cards

Pros of FCFS

1. Fair, as in, first come first serve principle.

2. Simple to implement (literally a queue)

3. Resolves the infinite-arrival starvation.

12
New cards

Cons of FCFS

Low Performance as a long CPU job could make al the other processes wait for a long-time.

13
New cards

Infinite-Blocking

A process infinitely-loops, causing the process to infinitely hog the CPU.

14
New cards

Infinite-Arrival

A continuous stream of newly arriving processes keeps getting selected ahead of an existing process, so that process is never chosen to run.

15
New cards

Shortest-Job First Principle

We execute the shortest-CPU jobs in increasing-order. Seen in both preemptive and non-preemptive.

16
New cards

Shortest Remaining Time First (SRFT)

Currently executing process may be interrupted by the new arrival of a process.

1. Low CPU burst time > arrival time gets priority.

17
New cards

Pros of SRFT

Low-CPU processes get executed first, which is more efficient than sequentially going through processes in a queue.

18
New cards

Cons of SRFT

1. Can lead to infinite-arrival as new processes keep interrupting, which prevents any process from being completed.

19
New cards

Turnaround Time

Completion Time - Arrival Time

20
New cards

Tie-breaker for SRFT and FCFS

If two processes have the same CPU burst time, we prioritize the one who arrived earlier.

21
New cards

Priority Scheduling Algorithim

Processes get an attached priority number that can be based on anything the user wants to prioritize. This can be based on CPU utilization ratio, time, random number, etc.

22
New cards

Round-Robin

The classic time-slicing concurrency algo.

23
New cards

Multi-level Queue

24
New cards

Multi-Level Feedback

CPU-hoggers get demoted (lower priority) while CPU-waiters get promoted (get higher priority).

25
New cards

Scheduler Components

Long, medium, short scheduler

26
New cards

Long Scheduler

It decided which newly created process gets admitted first.

27
New cards

Medium Scheduler

Swaps process from RAM to disk and vice versa.

28
New cards

Short Scheduler

It decides which process should be acted on by the CPU. Uses a set algorithim like SRFT, FCFS, etc.

29
New cards

Pros of Priority

1. We can differentiate based on semantic importance.

2. Allows preemptive & non-preemptive

30
New cards

Cons of Priority

1. Subject to both infinite-blocking and infinite-arrival starvations.

31
New cards

Pros of Round-Robin

1. Starvation Free (Everyone gets a turn)

2. Provides fairness

3. Establishes an upper-bound

32
New cards

Cons of Round-Robin

1. If time-quantum too large, it degrades to a FCFS algorithm

33
New cards

What if the time quantum is too small in Round-Robin scheduling?

We spend more time context-switching than actually working on processes.

34
New cards

Round-Robin Ratio

(dispatch latency) / (time-quantum + dispatch latency)

35
New cards

Multilevel Processing

We have multiple queues that may have different dispatch algorithms.