Difficulty: Easy
Correct Answer: A module that gives control of the CPU to the process selected by the short term scheduler by performing context switches and transferring execution to the new process.
Explanation:
Introduction / Context:
Within an operating system, the short term scheduler decides which ready process should run next, but another component must actually carry out the switch. This component is called the dispatcher. It handles the low level mechanics required to transfer control of the CPU from one process to another. This question asks you to identify what the dispatcher is and what it does during scheduling.
Given Data / Assumptions:
Concept / Approach:
The dispatcher is a part of the operating system that performs context switches. When the scheduler chooses a new process, the dispatcher saves the state of the currently running process into its process control block, loads the saved state of the next process and then transfers control by jumping to the new program counter. It may also handle switching to user mode and restoring the correct memory mapping. The time taken by the dispatcher to switch processes is called dispatch latency and affects how responsive the system feels.
Step-by-Step Solution:
Step 1: Recognise that scheduling has two parts: choosing which process should run and actually switching to it.
Step 2: Recall that the scheduler chooses the next process, but a different module must perform the save and restore operations.
Step 3: Identify this module as the dispatcher, which saves the current context and restores the context of the chosen process.
Step 4: Understand that the dispatcher also transfers control to the selected process by jumping to its program counter and possibly switching modes.
Step 5: Select the option that summarises this behaviour as giving control of the CPU to the process chosen by the scheduler through context switching.
Verification / Alternative check:
Operating system textbooks define the dispatcher as the module that gives control of the CPU to the process selected by the short term scheduler. They explicitly mention its responsibilities in context switching, switching to user mode and jumping to the correct execution point. This description matches the correct option and clearly differs from the device specific tasks described in the other options.
Why Other Options Are Wrong:
Option B describes a print spooler or printer driver, not the dispatcher involved in CPU scheduling. Option C refers to a network router, which is network hardware rather than an operating system module. Option D describes a battery monitoring utility, which has nothing to do with process context switching or CPU control.
Common Pitfalls:
A common mistake is to use the terms scheduler and dispatcher interchangeably. The scheduler decides, while the dispatcher acts on that decision. Another pitfall is to underestimate the impact of dispatch latency; if context switching is slow, frequent preemption can harm performance even when the scheduling algorithm is well designed.
Final Answer:
The dispatcher is the module that gives control of the CPU to the process selected by the short term scheduler by performing context switches and transferring execution to the new process.
Discussion & Comments