Process scheduling basics: Within the process scheduler, what is the primary function of the dispatcher component?

Difficulty: Easy

Correct Answer: assigning ready process to the CPU

Explanation:


Introduction / Context:
The scheduler decides which process should run; the dispatcher performs the low-level mechanics of context switching so that decision takes effect. Understanding this separation clarifies how operating systems multiplex the CPU among tasks.



Given Data / Assumptions:

  • A ready queue exists with runnable processes/threads.
  • The scheduler has chosen the next process.
  • The dispatcher will enact that choice.


Concept / Approach:

The dispatcher saves the state of the current process, loads the state of the chosen ready process (registers, program counter), switches to user mode, and transfers control. It may also handle TLB or address space changes. Thus, its core duty is to assign the ready process to the CPU by performing the context switch.



Step-by-Step Solution:

Recognize that swapping and memory loads are long-latency I/O activities.Identify the dispatcher as the quick, CPU-centric context switch unit.Match this to “assigning ready process to the CPU.”Select that option as correct.


Verification / Alternative check:

OS documentation separates long-term/medium-term scheduling from short-term dispatching; the dispatcher executes the scheduling decision immediately.



Why Other Options Are Wrong:

  • Swapping/bringing processes to memory: done by memory manager or medium-term scheduler.
  • Suspending due to load: a policy decision, not the dispatcher’s core role.


Common Pitfalls:

Conflating scheduler and dispatcher; assuming the dispatcher manages paging or swapping (it does not).


Final Answer:

assigning ready process to the CPU

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion