CPU Scheduling Items Flashcards

1
Q

What is the CPU scheduling about?

A

CPU scheduling is about deciding which tasks from the task queue should be executed by the CPU
and in what sequence. By controlling the execution order of tasks, CPU scheduling ensures efficient
utilization of CPU resources.

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

What does the choice of a specific CPU scheduling algorithm depend on?

A

The choice of a CPU scheduling algorithm primarily hinges on the system’s needs, including
efficiency goals, fairness, response time, and the nature of tasks (CPU or I/O intensive).

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

What is CPU burst? What is I/O burst?

A

A CPU burst is the period of time when a process is actively using the CPU for computations or
instructions, while an I/O burst is the period of time when a process is waiting for input/output
operations to complete, during which it is not using the CPU.

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

Why can it be beneficial to schedule short CPU burst processes to the CPU before long CPU burst
processes?

A

Scheduling short CPU burst processes before long ones can increase system responsiveness, reduce
waiting times for most processes, and improve overall throughput.

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

What does it mean a CPU scheduling algorithm is preemptive or non-preemptive?

A

A preemptive CPU scheduling algorithm allows a running process to be interrupted and replaced
by another process, typically a higher-priority one, while a non-preemptive algorithm lets a process
run to completion before scheduling another process

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

What does it mean a CPU scheduling algorithm is starvation free?

A

A starvation-free CPU scheduling algorithm ensures that every process will eventually get a chance
to execute, preventing situations where some processes never get CPU time.

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

First-Come-First-Served algorithm. Its idea, its advantages and disadvantages.

A

The First-Come-First-Served (FCFS) algorithm schedules processes based on their arrival time. Its
main advantage is simplicity and fast execution, and it is also free from starvation. However, its main
disadvantage is that it can lead to long wait times if the initially arriving processes have long CPU
bursts.

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

Shortest-Job-First algorithm. Its idea, its advantages, and disadvantages.

A

The Shortest-Job-First (SJF) algorithm schedules processes based on their burst time, starting with
the shortest. The main advantage of this algorithm is reduced average waiting time, and it is generally
fast. However, it requires prior knowledge of burst times, which may not always be available, and it
can potentially lead to starvation of longer tasks.

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

How can system know the duration of the next CPU burst

A

The duration of the next CPU burst can be estimated using several methods, including simple
averaging of previous burst times or exponential averaging, which gives more weight to recent
bursts.

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

Round-Robin algorithm. Its idea, its advantages, and disadvantages.

A

The Round-Robin (RR) algorithm assigns each process a fixed time quantum and incorporates a
limit on CPU utilization. If a process exceeds its time quantum, it is moved to the back of the queue.
RR ensures fairness, prevents starvation, and executes tasks efficiently. However, one of its
drawbacks is the potential for longer waiting times due to frequent context switches between
processes.

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

Priority scheduling. Its idea, its advantages, and disadvantages.

A

Priority scheduling assigns each process a priority and schedules the highest-priority processes first.
The advantage is that important tasks get processed first, but it can lead to starvation of low-priority
tasks.

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

Aging

A

Aging is a technique used to prevent starvation in priority scheduling by gradually increasing the
priority of tasks that have been waiting for a long time. As a process waits longer for the CPU, its
priority becomes higher.

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

Priority inversion and priority donation.

A

Priority inversion occurs when a high-priority task has to wait for a lower-priority task. Priority
donation is a technique to prevent this, where the lower-priority task temporarily inherits the higher
priority.

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

Real-time scheduling.

A

Real-time scheduling is used in systems where tasks have strict deadlines that must be met. The
scheduler is designed to ensure that critical tasks are completed within their specified deadlines.

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

Soft and hard real-time system.

A

In soft real-time systems, it’s acceptable if some deadlines are occasionally missed. In contrast, in
hard real-time systems, failing to meet a deadline is considered a system failure.

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