scheduling Flashcards

1
Q

What is the definition and objective of a CPU burst?

A

The period during which a process is actively executing instructions on the CPU. The process performs computations and executes instructions during this phase.

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

Explain the concept of an I/O burst and its objective.

A

The period during which a process is waiting for an I/O operation to be completed. The process is blocked, and the CPU is idle during this phase, waiting for the completion of a specific I/O operation (e.g., reading from disk, network communication).

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

Describe the typical behavior of the CPU – I/O Burst Cycle.

A

A process goes through a series of CPU and I/O bursts, creating a cycle. The CPU burst involves active execution on the CPU, while the I/O burst is characterized by the process waiting for an I/O operation to complete. This cycle repeats until the process finishes its task.

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

Provide an example scenario of a process going through CPU and I/O bursts.

A

A process might start with a CPU burst, performing computations. It then enters an I/O burst, waiting for data to be read from disk. After the I/O operation completes, the process resumes with another CPU burst.

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

How do scheduling techniques aim to overlap CPU and I/O bursts?

A

The goal is to overlap the execution of multiple processes to keep the CPU busy and minimize idle time. While one process is waiting for I/O, the CPU can be assigned to another process that is ready to execute.

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

What role does the CPU scheduler play when the CPU becomes idle?

A

The CPU scheduler selects a process from the ready queue to be executed when the CPU becomes idle. It allocates the CPU to the selected process, and the process control block (PCB) of the chosen process is loaded for execution.

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

How does the CPU scheduler select a process to be executed?

A

The CPU scheduler selects a process based on a scheduling algorithm, such as first-come, first-served (FCFS), shortest job first (SJF), or priority scheduling. The algorithm determines the order in which processes are chosen from the ready queue.

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

Explain the concept of a process control block (PCB).

A

A process control block (PCB) is a data structure containing information about a process. It includes details like process state, program counter, CPU registers, memory limits, and information about the process’s resources. The PCB is crucial for process management in the operating system.

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

What happens during a context switch, and why is it important?

A

During a context switch, the operating system saves the state of the current running process and restores the state of a new process to be executed. It involves updating the CPU registers and memory pointers. Context switches are important for multitasking, allowing multiple processes to share the CPU.

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

Differentiate between preemptive and nonpreemptive scheduling.

A

In preemptive scheduling, the operating system can interrupt a currently running process to start or resume another process. Nonpreemptive scheduling switches processes only under specific circumstances, such as when a process voluntarily relinquishes the CPU or terminates.

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

Describe the role of the dispatcher in the CPU-scheduling function.

A

The dispatcher is responsible for giving control of the CPU’s core to the process selected by the CPU scheduler. It involves switching context from one process to another, switching to user mode, and jumping to the proper location in the user program to resume execution.

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

What activities are involved in switching context from one process to another?

A

Context switching involves saving the state of the currently running process and restoring the state of the new process to be executed. It includes saving and loading CPU registers, updating memory pointers, and ensuring a smooth transition between processes.

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

Explain the concept of voluntary and non-voluntary context switches.

A

A voluntary context switch occurs when a process gives up control of the CPU voluntarily, such as when it blocks for I/O or terminates. A non-voluntary context switch happens when the CPU is taken away from a process, for example, when its time slice expires or preempted by a higher-priority process.

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

Why is the dispatch latency important, and how can it be minimized?

A

Dispatch latency is the time it takes for the dispatcher to stop one process and start another. It is crucial because it impacts system responsiveness. Minimizing dispatch latency involves optimizing the dispatcher’s efficiency and reducing the time taken for context switches.

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

Name and explain the criteria used for comparing CPU-scheduling algorithms.

A

CPU Utilization: Keep the CPU as busy as possible. Throughput: The number of processes completed per time unit. Turnaround Time: The interval from process submission to completion. Waiting Time: The time a process spends waiting in the ready queue. Response Time: The time from request submission to the first response produced.

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

What is the goal of CPU utilization, and what is its typical range?

A

The goal of CPU utilization is to keep the CPU as busy as possible. The typical range of CPU utilization in real systems is from 40 percent (lightly loaded) to 90 percent (heavily loaded).

17
Q

Define throughput and its measurement.

A

Throughput is the number of processes completed per time unit. It measures the system’s overall processing capacity and reflects the amount of work being done by the system.

18
Q

Explain the components of turnaround time.

A

Turnaround time is the interval from process submission to completion. Its components include the sum of time spent waiting in the ready queue, executing on the CPU, and performing I/O operations.

19
Q

How does the CPU-scheduling algorithm influence waiting time?

A

The CPU-scheduling algorithm determines the order in which processes are given a cpu burst