🎓 BookMCQ
← Back to 19. Windows 7

📝 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.
2
Easy
4
Medium
2
Hard

📝 All Windows 7 Kernel dispatcher MCQs

Q1. A driver attempts to bypass the HAL and access hardware registers directly. Which outcome is most likely?

A.The driver will gain faster access without any side effects
B.The operating system will automatically correct the access
C.The system may crash or become unstable due to missing abstraction ✅
D.The driver will be silently ignored by the kernel
💡 Difficulty: easy | ✅ Correct: C

📖 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?

A.Scheduling threads for execution ✅
B.Managing file system caches
C.Rendering graphical user interfaces
D.Handling network packet routing
💡 Difficulty: easy | ✅ Correct: A

📖 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?

A.First‑In‑First‑Out (FIFO) queue
B.Priority‑based pre‑emptive scheduling with round‑robin time slices ✅
C.Random selection of ready threads
D.Static allocation of threads to CPUs
💡 Difficulty: medium | ✅ Correct: B

📖 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?

A.It directly schedules threads on each CPU core
B.It provides a virtual hardware interface that abstracts chipset details ✅
C.It encrypts all kernel‑mode communications
D.It replaces the need for interrupt handling
💡 Difficulty: medium | ✅ Correct: B

📖 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?

A.Hardware Abstraction Layer ✅
B.High‑Level Application Logic
C.Hybrid Access Library
D.Host Authentication Layer
💡 Difficulty: medium | ✅ Correct: A

📖 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?

A.Driver configures DMA → HAL starts transfer → kernel dispatcher handles completion interrupt
B.HAL configures DMA → driver initiates transfer → kernel dispatcher logs the event
C.Driver requests DMA → HAL configures hardware → kernel dispatcher initiates transfer and processes interrupt ✅
D.Kernel dispatcher configures DMA → HAL validates request → driver performs transfer
💡 Difficulty: hard | ✅ Correct: C

📖 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?

A.To allow inheritance of hardware registers across devices
B.To encapsulate attributes and methods, promoting modularity and reuse ✅
C.To enable direct manipulation of memory addresses without safety checks
D.To simplify assembly language programming
💡 Difficulty: hard | ✅ Correct: B

📖 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?

A.Hardware‑Abstraction Layer
B.Executive
C.Kernel dispatcher ✅
D.Device driver
💡 Difficulty: medium | ✅ Correct: C

📖 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.

🔗 Related Topics (MCQs)