🎓 BookMCQ
← Back to 19. Windows 7

📝 Windows 7 Software interrupts: Asynchronous and deferred procedure calls (8 MCQs)

APCs and DPCs for Deferred Kernel Processing

Windows 7 uses Asynchronous Procedure Calls and Deferred Procedure Calls to schedule work outside the immediate execution of an interrupt service routine. A DPC performs deferred kernel work at a lower interrupt request level than the device ISR, while an APC arranges execution in a particular thread context. These mechanisms allow time-sensitive interrupt handling to remain relatively short.

Why Interrupt Handlers Must Avoid Lengthy Operations

Hardware interrupts can interrupt ordinary execution and may prevent lower-priority work from proceeding. Performing lengthy processing directly in an ISR increases interrupt latency and delays other devices. Windows therefore separates immediate hardware acknowledgement from work that can safely be postponed to a later execution context.

Interrupt, DPC Queue and APC Delivery

A device interrupt invokes an ISR, which acknowledges the device and may queue a DPC. The DPC runs later at DISPATCH_LEVEL to complete time-sensitive deferred work. An APC is queued to a target thread and executes when delivery is permitted, subject to alertable waits and APC type restrictions.

Example of Completing a Network Interrupt

A network adapter signals that packets have arrived. Its ISR acknowledges the interrupt and schedules a DPC. The DPC processes or arranges further packet handling without keeping the processor at the device's interrupt level. Additional work may be queued for worker threads when blocking operations are required.

Latency and Execution Context Constraints

DPCs reduce time spent in high-priority interrupt handling, but lengthy DPC routines can still delay ordinary threads. APCs support thread-directed work, yet their delivery depends on the target thread's state. Neither mechanism should be confused with an ordinary user-mode callback or a general replacement for thread scheduling.

Misconceptions About APCs and DPCs

'A DPC runs at the same interrupt level as its ISR' is false because it executes later at DISPATCH_LEVEL. 'Every APC executes immediately when queued' ignores delivery conditions. 'A DPC routine can safely perform blocking waits' is incorrect because DPC execution cannot wait like a passive-level thread.

Exam Focus: ISR, DPC and APC Execution Order

Trace device interrupt, ISR acknowledgement, DPC queuing, and deferred processing. Distinguish DPC execution level from APC thread context and passive-level worker routines. Questions may ask why an ISR must remain short or identify which mechanism can perform thread-specific deferred work.

Key Terms of Windows Deferred Processing

  • ISR - Interrupt Service Routine.
  • DPC - Deferred Procedure Call.
  • APC - Asynchronous Procedure Call.
  • IRQL - Interrupt Request Level.
  • DISPATCH_LEVEL - Execution level used for DPC routines.
2
Easy
4
Medium
2
Hard

📝 All Windows 7 Software interrupts: Asynchronous and deferred procedure calls MCQs

Q1. What is a Deferred Procedure Call (DPC) in the Windows kernel?

A.A hardware interrupt that directly schedules a thread
B.A software mechanism that postpones lower‑priority work to run after the interrupt handler finishes ✅
C.A user‑mode API for creating asynchronous tasks
D.A KERNEL MODE LOCK USED FOR SYNCHRONIZING ACCESS TO MEMORY
💡 Difficulty: easy | ✅ Correct: B

Q2. Why does the Windows kernel use DPCs instead of performing all work inside the interrupt service routine (ISR)?

A.DPCs allow the ISR to run at a lower priority than normal threads
B.DPCs execute in user mode, keeping the kernel safe
C.DPCs keep the ISR short, reducing interrupt latency and allowing other interrupts to be serviced promptly ✅
D.DPCS REPLACE THE NEED FOR HARDWARE TIMERS
💡 Difficulty: medium | ✅ Correct: C

Q3. How does the priority ordering of DPCs affect the handling of multiple asynchronous events arriving simultaneously?

A.All DPCs are executed in the order they were queued, regardless of priority
B.Higher‑priority DPCs are postponed until lower‑priority ones finish
C.Priority has no effect; DPCs are processed by a round‑robin scheduler
D.THE KERNEL SCHEDULES HIGHER‑PRIORITY DPCS BEFORE LOWER‑PRIORITY ONES, POTENTIALLY PRE‑EMPTING LOWER‑PRIORITY WORK ✅
💡 Difficulty: hard | ✅ Correct: D

Q4. A network driver receives a packet interrupt. Which sequence correctly uses a DPC to process the packet while keeping the ISR short?

A.ISR queues a DPC, returns quickly; DPC later copies packet data and signals upper‑level protocol ✅
B.ISR processes the entire packet, then queues a DPC to log the event
C.ISR disables all other interrupts, processes packet, and never uses a DPC
D.ISR DIRECTLY CALLS USER‑MODE CODE TO HANDLE PACKET
💡 Difficulty: easy | ✅ Correct: A

Q5. A developer wants to schedule a periodic task that runs every 10 ms without blocking the timer interrupt. Which kernel mechanism should be used?

A.Create a high‑priority thread that sleeps for 10 ms
B.Set a timer that queues a DPC at each interval ✅
C.Use a spin lock inside the ISR to perform the work
D.IMPLEMENT A USER‑MODE CALLBACK IN THE SERVICE CONTROL MANAGER
💡 Difficulty: medium | ✅ Correct: B

Q6. During debugging, a system crash occurs after a DPC runs for an extended period. Which of the following is the most likely cause?

A.The ISR failed to acknowledge the hardware interrupt
B.The DPC was queued at a low priority, causing starvation
C.The DPC executed code that accessed pageable memory at DISPATCH_LEVEL ✅
D.THE DPC WAS SCHEDULED FROM USER MODE, VIOLATING SECURITY POLICIES
💡 Difficulty: hard | ✅ Correct: C

Q7. Two drivers queue DPCs at the same priority level. Driver X's DPC must complete before Driver Y's DPC can safely access a shared buffer. Which synchronization technique should the developers use?

A.Raise the IRQL to HIGH_LEVEL for both DPCs
B.Use a spin lock inside the ISR only
C.Rely on the FIFO order of DPC queue
D.PROTECT THE BUFFER WITH A KERNEL‑MODE SPIN LOCK ACQUIRED IN EACH DPC ✅
💡 Difficulty: medium | ✅ Correct: D

Q8. What distinguishes an asynchronous software interrupt from a synchronous software interrupt in Windows?

A.Asynchronous interrupts can be raised at any time, while synchronous interrupts are generated as a direct result of a executing instruction ✅
B.Asynchronous interrupts require user‑mode involvement, whereas synchronous interrupts are kernel‑only
C.Asynchronous interrupts always have higher priority than synchronous ones
D.THERE IS NO DISTINCTION; WINDOWS TREATS ALL SOFTWARE INTERRUPTS THE SAME
💡 Difficulty: medium | ✅ Correct: A

🔗 Related Topics (MCQs)