Process Management Question Bank for C-CAT
Topic-wise Process Management MCQs for CDAC C-CAT preparation with answers and explanations.
Show Answer & Explanation
Correct Answer: B - Process state, registers, memory info
PCB stores process ID, state, registers, memory limits, scheduling info, etc.
Show Answer & Explanation
Correct Answer: B - New, Ready, Running, Waiting, Terminated
Five process states: New, Ready, Running, Waiting (Blocked), Terminated.
Show Answer & Explanation
Correct Answer: B - Creates new process
fork() creates a child process as copy of parent.
Show Answer & Explanation
Correct Answer: B - Terminated but entry in process table exists
Zombie: process terminated but parent hasn't read its exit status.
Show Answer & Explanation
Correct Answer: D - Child whose parent terminated
Orphan process: child process whose parent has terminated.
Show Answer & Explanation
Correct Answer: C - Code, data, files
Threads share code, data, and files; each has own stack and registers.
Show Answer & Explanation
Correct Answer: B - Multiple CPUs
Multiprocessing uses multiple processors/CPUs.
Show Answer & Explanation
Correct Answer: C - Mutual exclusion lock
Mutex ensures mutual exclusion in critical sections.
Show Answer & Explanation
Correct Answer: D - Mutual exclusion, Progress, Bounded waiting
Three requirements: Mutual Exclusion, Progress, Bounded Waiting.
Show Answer & Explanation
Correct Answer: C - Semaphores (mutex + full + empty)
Uses mutex for critical section, full and empty semaphores for synchronization.
Show Answer & Explanation
Correct Answer: D - Saving and restoring process state
Context switching saves current process state and restores the state of another process.
Show Answer & Explanation
Correct Answer: B - OS can interrupt running process
Preemptive scheduling allows OS to interrupt a running process to run another.
Show Answer & Explanation
Correct Answer: D - Process runs until it voluntarily releases CPU
In non-preemptive scheduling, a process runs until it completes or blocks voluntarily.
Show Answer & Explanation
Correct Answer: A - LRU
LRU (Least Recently Used) is a page replacement algorithm, not CPU scheduling.
Show Answer & Explanation
Correct Answer: D - FCFS
Convoy effect in FCFS: short processes wait behind long process.
Show Answer & Explanation
Correct Answer: D - SJF and Priority scheduling
Starvation can occur in SJF (long jobs) and Priority scheduling (low priority jobs).
Show Answer & Explanation
Correct Answer: C - Starvation
Aging gradually increases priority of waiting processes to prevent starvation.
Show Answer & Explanation
Correct Answer: B - Shared memory and message passing
IPC methods include shared memory, message passing, pipes, and sockets.
Show Answer & Explanation
Correct Answer: C - fork()
fork() creates a new child process as a copy of the parent process.
Show Answer & Explanation
Correct Answer: C - To prevent race conditions
Synchronization prevents race conditions when multiple processes access shared resources.
Show Answer & Explanation
Correct Answer: B - Compiled
The valid process states are New, Ready, Running, Waiting (Blocked), and Terminated. 'Compiled' is not a process state — compilation happens before a process is created.
Show Answer & Explanation
Correct Answer: B - Process state, program counter, CPU registers, memory management info, scheduling info
A PCB contains all information about a process: process state, process ID, program counter, CPU registers, memory management information, I/O status, scheduling information, and accounting information.
Show Answer & Explanation
Correct Answer: D - A lightweight process that is the smallest unit of CPU execution
A thread is a lightweight process and the smallest unit of CPU execution. Threads within the same process share code, data, and OS resources but have their own program counter, registers, and stack.
Show Answer & Explanation
Correct Answer: D - Mutual exclusion, hold and wait, no preemption, circular wait
The four necessary conditions for deadlock (Coffman conditions) are: Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait. All four must hold simultaneously for a deadlock to occur.
Show Answer & Explanation
Correct Answer: D - User-level threads are managed by a thread library; kernel-level threads are managed by the OS
User-level threads are managed entirely by a user-space thread library (the kernel is unaware of them), while kernel-level threads are managed directly by the OS kernel. Kernel threads can be scheduled independently.
Show Answer & Explanation
Correct Answer: C - Peterson's solution
Peterson's solution is a classic software-based solution to the critical section problem for two processes. It satisfies all three requirements: mutual exclusion, progress, and bounded waiting.
Show Answer & Explanation
Correct Answer: C - A synchronization tool that uses an integer variable with atomic wait() and signal() operations
A semaphore is a synchronization tool consisting of an integer variable accessed through two atomic operations: wait() (P) and signal() (V). It is used to control access to shared resources.
Show Answer & Explanation
Correct Answer: D - A classic synchronization problem where producers generate data and consumers consume it from a shared buffer
The producer-consumer problem is a classic synchronization problem where producer processes produce data items and place them in a shared buffer, while consumer processes remove and consume items from the buffer.
Show Answer & Explanation
Correct Answer: A - Banker's algorithm
Banker's algorithm is a deadlock avoidance algorithm that checks whether granting a resource request would lead to an unsafe state. It considers maximum needs, current allocation, and available resources.
Show Answer & Explanation
Correct Answer: C - Threads share the same address space; processes have separate address spaces
Threads within the same process share the same address space (code, data, files), while processes have separate address spaces. Thread creation and context switching is faster than process creation.
Show Answer & Explanation
Correct Answer: C - A terminated process whose exit status has not been collected by its parent
A zombie process is a process that has completed execution but still has an entry in the process table because its parent hasn't called wait() to read its exit status. It consumes a PID but no other resources.
Show Answer & Explanation
Correct Answer: D - When the outcome depends on the order of execution of concurrent processes accessing shared data
A race condition occurs when multiple processes or threads access shared data concurrently and the final result depends on the particular order of execution. It can lead to inconsistent or incorrect results.
Show Answer & Explanation
Correct Answer: A - A mutual exclusion lock that allows only one thread to access a resource at a time
A mutex (mutual exclusion) is a synchronization primitive that allows only one thread to enter a critical section at a time. A thread must acquire the mutex before entering and release it when leaving.
Show Answer & Explanation
Correct Answer: A - Deadlock detection and recovery
Deadlock detection and recovery allows deadlocks to occur, detects them using algorithms (like wait-for graph), and recovers by terminating one or more processes or preempting resources.
Show Answer & Explanation
Correct Answer: A - A synchronization problem where multiple readers can read simultaneously but writers need exclusive access
The readers-writers problem is a synchronization problem where multiple readers can read a shared resource simultaneously, but a writer must have exclusive access. No other reader or writer can access the resource while a writer is writing.
Show Answer & Explanation
Correct Answer: B - Concurrency and synchronization challenges like deadlock and starvation
The dining philosophers problem illustrates synchronization challenges in concurrent systems, particularly deadlock and starvation. Five philosophers share forks and must pick up two to eat, risking deadlock.
Show Answer & Explanation
Correct Answer: B - There exists at least one sequence in which all processes can complete
A safe state means there exists a safe sequence — an order in which all processes can be allocated their maximum resources and complete. If the system is in a safe state, deadlock cannot occur.
Show Answer & Explanation
Correct Answer: C - It issues an I/O request or waits for an event
A process moves from Running to Waiting (Blocked) state when it needs to wait for something — typically an I/O operation or an event (like a signal from another process or a resource becoming available).
Show Answer & Explanation
Correct Answer: D - To make a parent process wait until one of its child processes terminates
The wait() system call causes a parent process to block until one of its child processes terminates. It also allows the parent to collect the child's exit status, preventing zombie processes.
Show Answer & Explanation
Correct Answer: A - A child process whose parent has terminated
An orphan process is a child process that continues running after its parent process has terminated. In Unix/Linux, orphan processes are adopted by the init process (PID 1) which calls wait() for them.
Show Answer & Explanation
Correct Answer: A - Controlling access to a resource with multiple instances
A counting semaphore has an integer value that can range over an unrestricted domain. It is used to control access to a resource with a finite number of instances, such as a connection pool.
Show Answer & Explanation
Correct Answer: A - It atomically tests and modifies a memory word, ensuring mutual exclusion
Test-and-set is an atomic hardware instruction that reads the old value of a memory word and sets it to TRUE in one indivisible operation. This atomicity ensures mutual exclusion in the critical section.
Show Answer & Explanation
Correct Answer: A - Whether there exists a sequence where each process can get its max resources and finish
The safety algorithm checks if a safe sequence exists — an order in which processes can be allocated their remaining needed resources (Max - Allocation) from available resources and complete.
Show Answer & Explanation
Correct Answer: A - When a high-priority process waits for a resource held by a low-priority process
Priority inversion occurs when a high-priority process is indirectly blocked by a low-priority process because the low-priority process holds a shared resource. Priority inheritance protocol can solve this.
Show Answer & Explanation
Correct Answer: B - A high-level synchronization construct that encapsulates shared data with procedures and condition variables
A monitor is a high-level synchronization construct that encapsulates shared data, procedures to operate on that data, and condition variables for synchronization. Only one process can be active in a monitor at a time.
Show Answer & Explanation
Correct Answer: C - To increment the semaphore value and potentially wake up a waiting process
The signal() (V) operation increments the semaphore value. If there are processes waiting on the semaphore, one of them is woken up and allowed to proceed into the critical section.
Show Answer & Explanation
Correct Answer: A - A deadlock may exist (if multiple instances) or definitely exists (if single instance)
In a resource allocation graph, a cycle is a necessary condition for deadlock. If each resource type has only one instance, a cycle implies deadlock. With multiple instances, a cycle is necessary but not sufficient.
Show Answer & Explanation
Correct Answer: A - Improved responsiveness, resource sharing, and better utilization of multiprocessor architectures
Multithreading provides improved responsiveness (one thread can handle UI while another computes), resource sharing (threads share process resources), economy (cheaper than creating new processes), and scalability on multiprocessor systems.
Show Answer & Explanation
Correct Answer: B - Binary semaphore can only be 0 or 1; counting semaphore can be any non-negative integer
A binary semaphore can only take values 0 or 1 and is similar to a mutex lock. A counting semaphore can take any non-negative integer value and is used to control access to resources with multiple instances.
Show Answer & Explanation
Correct Answer: A - By imposing a total ordering on resource types and requiring processes to request resources in order
Circular wait can be prevented by assigning a unique number to each resource type and requiring each process to request resources in increasing order of their numbering. This breaks the possibility of a circular chain.