📝 Process management in Window 7 (5 MCQs)
Managing Process Containers and Execution Resources
Windows 7 process management creates, tracks, and terminates process environments while coordinating their threads, virtual address spaces, handles, security tokens, and resource relationships. A process represents an executing program's resource context, whereas its threads are the entities scheduled on processors. The Process Manager works with the Memory Manager, Object Manager, and scheduler to control process lifecycles.
Why Process Isolation and Resource Ownership Matter
Running applications in separate process environments limits unintended interference and supports controlled resource sharing. A process needs its own address space and security identity, while its threads require independent execution states. Separating these responsibilities enables one application to host multiple threads and the system to run many applications concurrently.
CreateProcess, Thread Setup and Termination
CreateProcess requests a new process and its initial thread. Windows establishes process structures, loads the executable image, creates an address space, assigns security context, and returns handles. Additional threads may be created later. Process termination occurs after its final thread exits or an authorised termination operation succeeds.
Example of Managing a Child Process
A parent program starts two worker applications using CreateProcess. Windows assigns each child a separate process object, address space, and security context. The parent retains process handles and waits for completion using a suitable wait function, then retrieves exit information and releases its handles.
Resource Accounting and Process Isolation
Process management supports application separation, security, and resource tracking. Every process consumes kernel objects, memory, handles, and scheduling resources. Excessive process creation can reduce system performance, while insufficient cleanup may leave handles or background processes active. Process-level isolation also cannot protect the system from every privileged driver fault.
Misconceptions About Windows Process Management
'Processes are the units selected directly by the scheduler' is false because Windows schedules threads. 'A child process always shares its parent's address space' ignores Windows process creation semantics. 'A terminated thread always ends its process' is incorrect when other process threads remain active.
Exam Focus: Process Creation and Resource Lifecycle
Trace process creation, executable loading, initial thread creation, scheduling, and termination. Identify resources belonging to a process versus individual threads. Questions may examine CreateProcess handles, address-space separation, inherited resources, process exit status, and why process cleanup matters.
Key Terms of Windows Process Management
- Process - Container for execution resources.
- Thread - Schedulable execution path.
- CreateProcess - API creating a process and initial thread.
- Address space - Virtual memory available to a process.
- Exit code - Status returned when a process terminates.
📝 All Process management in Window 7 MCQs
Q1. What does APC stand for?
📖 Explanation: APC is an abbreviation for Asynchronous Procedure Call. This term describes a mechanism that lets the operating system queue a routine to run in the context of a specific thread. The other choices either describe a different concept (Deferred Procedure Call) or are unrelated terms. Knowing the exact meaning helps identify when APCs are appropriate, such as initiating new threads or handling I/O completion.
Q2. Why are APCs only delivered when a thread is in an alertable wait state?
📖 Explanation: APCs are delivered only when a thread is in an alertable wait because this guarantees a safe point where user‑mode code can run without disrupting critical kernel operations. The other options are incorrect: APCs do not need higher priority than normal threads, they are not limited to hardware interrupt handling, and the scheduler does not block them arbitrarily. This rule prevents race conditions and maintains system stability.
Q3. A driver queues a DPC after handling a high‑priority interrupt. When will the DPC execute?
📖 Explanation: A DPC runs when the CPU priority drops below that of device interrupts yet stays above the priority used for regular thread scheduling. This ensures urgent interrupt work is handled first, then the deferred work runs without delaying other ISRs. The other choices are wrong: it does not run immediately after the ISR, nor does it wait for the system to be idle, and it certainly does not wait for all device interrupts to finish before any DPC can run.
Q4. How does using a pool of worker threads improve system responsiveness compared to executing DPC routines directly?
📖 Explanation: A pool of worker threads lets the system offload longer‑running work from DPCs, keeping DPC routines short. Short DPCs avoid delaying other device interrupts and maintain quick context switches, which improves overall responsiveness. Running heavy code directly in DPCs could block higher‑priority ISRs. The other statements are inaccurate: worker threads do not run at higher priority than DPCs, they do not replace APCs, and they do not increase interrupt latency.
Q5. A process needs a thread to be terminated right after an I/O operation completes. Which mechanism should be used to safely stop the thread?
📖 Explanation: The appropriate mechanism is an APC because APCs can be queued to a specific thread to perform actions such as termination, especially when the thread is in an alertable state after I/O completion. DPCs are intended for deferred interrupt processing and run at a different priority, making them unsuitable for safely stopping a thread. Hardware ISRs and timer callbacks operate at even lower levels and cannot target a particular thread for termination. Using an APC ensures the thread is stopped in a controlled, context‑aware manner.