📝 Windows 7 Kernel dispatcher (8 MCQs)
Dispatcher Control of Thread Execution
The Windows 7 kernel dispatcher manages the selection and execution of threads on available processors. It works with the scheduler's priority and readiness information to choose a thread from the ready state and perform context switches. The dispatcher also manages waits on kernel dispatcher objects, coordinating thread execution with events, timers, mutexes, semaphores, and other synchronisation facilities.
Why Ready Threads Need a Selection Mechanism
Many threads may be ready while only a limited number of processors can execute them simultaneously. The dispatcher must select an eligible thread based on priority and scheduling rules. It must also switch execution when a higher-priority thread becomes ready or the current thread blocks, terminates, or exhausts its scheduling quantum.
Ready Queues, Wait States and Context Switching
The dispatcher selects an appropriate ready thread and restores its processor context. If a thread waits for an object, the kernel places it in a wait state. When the object becomes signalled or a timeout occurs, the thread becomes eligible for execution and can return to a ready queue.
Example of a Higher Priority Thread
A low-priority thread is running when an I/O completion makes a higher-priority thread ready. The scheduler requests a pre-emption, and the dispatcher saves the current context and switches to the higher-priority thread. The original thread remains eligible to resume after higher-priority work finishes.
Priority Responsiveness and Switching Overhead
Dispatcher decisions support pre-emption, responsiveness, and synchronisation across multiprocessor systems. Frequent context switches consume CPU time, while priority imbalances can delay lower-priority work. The dispatcher also handles wait completion and processor selection, so its operation affects both application scheduling and kernel responsiveness.
Misconceptions About the Dispatcher
'The dispatcher selects processes only by arrival time' ignores priority-based thread scheduling. 'A waiting thread continues using CPU time' is false because it is not runnable. 'Every context switch creates a new process' confuses switching execution context with process creation.
Exam Focus: Ready, Running and Waiting Transitions
Trace transitions among ready, running, and waiting thread states. Explain how priority pre-emption and dispatcher-object signalling affect selection. Questions may ask when a context switch occurs or distinguish dispatcher scheduling from the higher-level process and thread management services.
Key Terms of the Windows Dispatcher
- Dispatcher - Controls thread selection and switching.
- Ready thread - Thread eligible for CPU execution.
- Wait state - State awaiting an event or resource.
- Context switch - Change of executing thread.
- Dispatcher object - Kernel object used for synchronisation or waiting.
📝 All Windows 7 Kernel dispatcher MCQs
Q1. A driver attempts to bypass the HAL and access hardware registers directly. Which outcome is most likely?
📖 Explanation: Bypassing the HAL removes the layer that translates hardware differences into a uniform interface. Without this translation, the kernel cannot guarantee that the driver’s register accesses match the actual device layout, leading to unpredictable behavior. Option C describes the likely result—system instability or a crash—because the kernel relies on HAL for safe hardware interaction. Option A is wrong because direct access can cause conflicts, not faster safe operation. Option B is incorrect; the OS does not auto‑correct illegal accesses. Option D is false because the kernel will still execute the driver code, not ignore it. In real systems, respecting the HAL prevents crashes and maintains reliability.
Q2. What is the primary responsibility of the Windows kernel dispatcher?
📖 Explanation: The kernel dispatcher’s core duty is to decide which thread runs on a processor and when, implementing the scheduling policy of the OS. Option A captures this function by focusing on thread scheduling. Options B, C, and D describe tasks handled by other components such as the memory manager, graphics subsystem, and networking stack, respectively. Because the dispatcher directly influences CPU time allocation, understanding its role helps administrators predict performance under load and developers design efficient multithreaded applications.
Q3. In a multi‑CPU Windows system, which scheduling mechanism does the kernel dispatcher typically use to ensure fairness among threads of equal priority?
📖 Explanation: When threads share the same priority, the dispatcher combines priority‑based pre‑emptive scheduling with round‑robin time slices, giving each thread a fixed quantum before moving to the next ready thread. This approach, described in option B, balances responsiveness and fairness. FIFO (option A) would let a single thread dominate until it yields, violating fairness. Random selection (option C) would cause unpredictable performance and is not used in production Windows kernels. Static allocation (option D) ignores dynamic load, leading to idle CPUs. Understanding this policy helps developers tune thread priorities for optimal throughput.
Q4. How does the Hardware‑Abstraction Layer (HAL) assist the kernel dispatcher in handling device‑specific operations?
📖 Explanation: The HAL offers a consistent set of functions that hide the nuances of different chipsets, presenting a virtual hardware view to the kernel dispatcher and other kernel components. This abstraction, highlighted in option B, allows the dispatcher to request I/O or DMA without knowing the exact physical layout. Option A is unrelated because thread scheduling is a dispatcher task, not a HAL function. Option C is false; encryption is not a HAL responsibility. Option D is incorrect because interrupts still need handling; the HAL merely supplies the information needed for that handling. By using the HAL, developers write drivers once for each CPU architecture, simplifying deployment.
Q5. What does the acronym HAL stand for in Windows architecture?
📖 Explanation: HAL stands for Hardware Abstraction Layer, which is the component that isolates the operating system from the physical details of the computer’s hardware. Option A correctly expands the acronym. The other options invent unrelated terms: High‑Level Application Logic (B) suggests a user‑space concept, Hybrid Access Library (C) sounds like a software library, and Host Authentication Layer (D) refers to security, none of which describe the HAL’s role. Recognizing the correct expansion helps students differentiate between system layers and understand why drivers rely on HAL for consistent hardware access.
Q6. A driver needs to perform a DMA transfer. Which sequence correctly describes the interaction among the driver, HAL, and kernel dispatcher?
📖 Explanation: The proper flow begins with the driver issuing a DMA request, after which the HAL translates that request into chipset‑specific commands and sets up the DMA engine. The kernel dispatcher then triggers the transfer and later handles the interrupt that signals completion, as described in option C. Option A places the HAL after the driver’s configuration, which is reversed; the HAL must configure hardware before the dispatcher starts the operation. Option B assigns the driver to start the transfer without HAL preparation, which is unsafe. Option D incorrectly gives the dispatcher the initial configuration role, which belongs to the HAL. Knowing this order ensures that developers correctly implement DMA‑enabled drivers.
Q7. Why does the Windows kernel employ object‑oriented design for its internal components?
📖 Explanation: Object‑oriented design groups related data (attributes) and functions (methods) into objects, making each kernel component self‑contained and easier to manage. This encapsulation, highlighted in option B, supports modular development, code reuse, and clearer interfaces between dispatcher, executive, and other subsystems. Option A misinterprets inheritance; hardware registers are not inherited in this sense. Option C suggests unsafe practices that the kernel explicitly avoids through protection mechanisms. Option D is unrelated because object orientation reduces, rather than simplifies, the need for assembly code. Understanding this design choice helps students appreciate how Windows maintains stability while evolving features.
Q8. When a user‑mode application invokes a system call, which component is responsible for switching execution from user mode to kernel mode?
📖 Explanation: The transition from user mode to kernel mode is managed by the kernel dispatcher, which validates the system call, saves the user context, and transfers control to the appropriate kernel routine. Option C correctly identifies this role. The HAL (option A) provides hardware abstraction but does not perform mode switches. The executive (option B) contains higher‑level services that run after the dispatcher has entered kernel mode. Device drivers (option D) handle specific hardware after the kernel has taken control. Recognizing the dispatcher’s function clarifies how Windows enforces security and isolation during system calls.