🎓 BookMCQ
← Back to 19. Windows 7

📝 Scheduling rule in Process management in Window 7 (6 MCQs)

Preemptive Priority Scheduling in Windows 7

Windows 7 uses priority-driven pre-emptive scheduling to allocate processor time among runnable threads. The scheduler selects the highest-priority eligible thread for an available CPU, with round-robin selection among equal-priority ready threads. Thread priorities are organised into variable and real-time ranges, while quantum allocation influences how long a thread runs before reconsideration.

Why Priority Rules Must Balance Responsiveness and Fairness

Interactive programs, background services, and time-sensitive tasks have different response requirements. A simple arrival-order policy would not adequately prioritise urgent work. Windows uses priority levels and pre-emption to respond to important threads, while dynamic adjustments can improve responsiveness for selected interactive workloads.

Ready Queues, Priority Selection and Quantum

The scheduler maintains ready threads organised by priority. A newly ready thread with a higher priority can pre-empt the current thread. Threads at the same priority share execution through quantum-based rotation, while waiting threads become ready after an event or resource becomes available.

Example of Priority Based Pre-emption

A normal application thread is running at priority 8. A device event makes a ready thread at priority 12 eligible for execution. The scheduler selects the higher-priority thread and the dispatcher performs a context switch. The original thread remains ready and can resume when higher-priority work no longer requires the CPU.

Priority Responsiveness and Starvation Risk

Priority scheduling helps important tasks respond quickly, but sustained high-priority work may delay lower-priority threads. Windows can apply dynamic priority boosts for selected events, while real-time priorities require careful use. Scheduling behaviour also depends on processor availability, affinity, quantum settings, and the current Windows edition and configuration.

Misconceptions About Windows Scheduling Rules

'The scheduler chooses the oldest ready thread first' ignores priority selection. 'A higher numeric priority value means lower priority' reverses Windows priority ordering. 'Every thread receives the same quantum and CPU share' overlooks priority classes, thread state, and scheduling adjustments.

Exam Focus: Priority Pre-emption and Ready Queues

Compare two ready threads by priority and identify which executes first. Explain pre-emption, equal-priority rotation, and quantum expiration. Questions may examine dynamic priority boosts, real-time levels, starvation, or the distinction between scheduling priority and the priority class selected for a process.

Key Terms of Windows Scheduling Rules

  • Pre-emption - Interrupting one thread for another.
  • Ready queue - Collection of runnable threads.
  • Priority - Scheduling importance assigned to a thread.
  • Quantum - Allocated processor time interval.
  • Dynamic boost - Temporary increase in thread priority.
1
Easy
3
Medium
2
Hard

📝 All Scheduling rule in Process management in Window 7 MCQs

Q1. What does APC stand for in Windows kernel terminology?

A.Asynchronous Procedure Call ✅
B.Automatic Process Control
C.Asynchronous Process Communication
D.Automatic Procedure Completion
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: An APC, or Asynchronous Procedure Call, is a mechanism that allows the system to execute a procedure in the context of a specific thread at a later, safe point. Option A correctly defines this term. Options B, C, and D describe unrelated concepts; they do not match the established abbreviation. Understanding the exact meaning helps developers correctly use APCs for thread control and I/O notifications.

Q2. Why are Deferred Procedure Calls (DPC) scheduled at a priority lower than hardware interrupt service routines but higher than normal thread execution?

A.To ensure DPCs finish before any ISR runs
B.To allow ISRs to handle time‑critical work while DPCs handle less urgent processing without pre‑empting user threads ✅
C.Because DPCs are part of user‑mode code
D.To prioritize network traffic over disk I/O
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: DPCs are placed below hardware ISRs so that the most urgent interrupt handling is never delayed. At the same time, they sit above normal threads, ensuring that the deferred work completes before regular scheduling resumes. This ordering balances responsiveness and system stability. Option B captures this hierarchy; the other options misrepresent the priority relationship or the execution mode of DPCs.

Q3. How does the requirement that user‑mode APCs can execute only when a thread is in an alertable wait state affect system responsiveness and security?

A.It allows APCs to run at any time, improving responsiveness
B.It limits APC execution to controlled points, reducing the risk of unexpected code execution ✅
C.It forces all APCs to run in kernel mode
D.It disables APCs for background services
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: User‑mode APCs are only delivered when a thread voluntarily enters an alertable wait, which creates a predictable point for execution. This limitation prevents APCs from interrupting arbitrary code paths, enhancing security by reducing opportunities for malicious injection. At the same time, it can modestly affect responsiveness because the APC must wait for the alertable state. Options A, C, and D describe incorrect behaviors that do not align with the Windows scheduling model.

Q4. A driver receives a high‑frequency hardware interrupt. The ISR quickly queues a DPC to process the data and then returns. If the DPC routine takes longer than the scheduling quantum, what is the most likely impact on other threads on the same CPU?

A.Other threads will be pre‑empted until the DPC finishes ✅
B.The DPC will be split across multiple quanta automatically
C.The scheduler will delay the DPC and run pending threads first
D.The system will raise an exception and halt the driver
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When a DPC runs, it monopolizes the CPU at a priority above normal threads, preventing those threads from being scheduled until the DPC yields or completes. If the DPC exceeds its quantum, the scheduler does not pre‑empt it for regular threads, so other threads remain blocked. Option A describes this behavior. Options B and C suggest mechanisms that do not exist for DPCs, and D describes an extreme error condition that is not typical for long DPC execution.

Q5. Suppose a developer queues a long‑running computation to a worker thread via a DPC, instead of using the thread pool. Which of the following best describes the effect on overall system latency?

A.Latency decreases because DPCs run at higher priority than regular threads
B.Latency remains unchanged since DPCs and worker threads have the same priority
C.Latency may increase because the DPC blocks other DPCs and prevents timely interrupt handling ✅
D.Latency improves because the computation is offloaded from the ISR
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Running a lengthy task as a DPC elevates its priority above normal threads, which can delay other DPCs and critical interrupt processing, thereby raising overall latency. Option C captures this side effect. Option A incorrectly assumes higher priority always improves latency, while B ignores the priority difference. Option D misstates the relationship between ISR and DPC, as moving work to a DPC does not inherently speed up ISR handling.

Q6. In a multi‑core system, a thread is marked alertable and awaiting I/O completion. Simultaneously, a high‑priority DPC is queued on the same core. Which sequence ensures that the thread’s APC runs after the DPC without starving the thread?

A.The scheduler raises the thread’s priority above the DPC
B.The DPC runs to completion, then the scheduler delivers the APC when the thread re‑enters an alertable wait ✅
C.The APC pre‑empts the DPC immediately
D.Both the DPC and APC are executed concurrently on the same core
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: The correct order is that the DPC executes first because it has higher priority than normal threads, and once it finishes, the scheduler checks for pending APCs when the thread returns to an alertable wait state. This guarantees the APC runs after the DPC without causing starvation. Option B describes this flow. Option A would invert priorities, which is not allowed. Option C suggests pre‑emption that does not occur, and Option D describes an impossible simultaneous execution on a single core.

🔗 Related Topics (MCQs)