Q: 1 Cascading termination refers to termination of all child processes, if the parent process terminates –
Normally or Abnormally
Abnormally
Normally
None of the mentioned
[ Option A ]
Cascading termination refers to the situation where the termination of a parent process leads to the automatic termination of all its child processes. This mechanism is implemented by the operating system to avoid the creation of orphan processes, which are child processes left without a parent to manage them.
Importantly, cascading termination occurs regardless of whether the parent process terminates normally after completing its execution or abnormally due to an error or external interruption. This policy helps maintain system stability by cleaning up all associated child processes when the parent ends.
Q: 2 When a process is in a "Blocked" state it waits for some I/O service. When the service is completed it goes to the-
Terminated state
Suspended state
Running state
Ready state
[ Option D ]
When a process is in the Blocked State, it is waiting for some I/O service or resource to become available. Once the I/O operation or the required event is completed, the process cannot immediately start executing because the CPU may currently be busy with other processes. Therefore, it transitions to the Ready State.
Q: 3 Consider two processes, P3 and P4, that share global variables b and c, with initial values b = 1 and c = 2. At some point in its execution, P3 executes the assignment b = b + c, and at some point in its execution, P4 executes the assignment c = b + c. if P3 executes its assignment statement first, then the final values of b and c are :
b = 3 and c = 5
b = 5 and c = 3
b = 3 and c = 4
b = 4 and c = 3
[ Option A ]
Q: 4 Which of the following is saved during a context switch?
Only the process ID
CPU register values, memory information and process state
Network status and battery level
Only the process priority
[ Option B ]
A context switch occurs when the CPU switches from executing one process (or thread) to another.
During this switch, the state (context) of the currently running process must be saved so that it can resume later exactly where it left off. The new process’s context is then loaded so that it can continue its execution.
The context of a process is stored in a special data structure called the Process Control Block (PCB).
The system saves all the information required to restart the process later, including, CPU Register Values (like program counter, accumulator, etc.), Process State (e.g., ready, waiting, running), Memory Management Information (base and limit registers, page tables, etc.)
This ensures that when the process resumes, it continues execution from the exact same point.
Q: 5 Consider the following statement –
(i) A child process that remains running even after its parent process is terminated or completed without waiting for the child process execution is called an orphan.
(ii) A process that has completed its task but still, it shows an entry in a process table is called a zombie process.
Both are True
Both are False
Only I is True
Only II is True
[ Option A ]
Orphan Process:
In operating systems, when a parent process terminates before its child process completes, the child process is still running. Such a child process is called an orphan. Typically, the orphan process is adopted by the init process, ensuring proper cleanup when it finishes.
Zombie Process:
A zombie process is a process that has finished execution but still appears in the process table because its parent process has not yet collected its exit status via the wait() system call. Zombie processes do not consume CPU resources but occupy a slot in the process table until the parent collects the exit information.
Q: 6 The Kernel dispatcher keeps track of all _________ threads and schedules them in priority order.
Ready
Standby
Running
Waiting
[ Option A ]
In an Operating System (OS), the kernel dispatcher (scheduler) is responsible for managing CPU time among different threads or processes. It decides which thread should run next based on their state and priority.
Threads in an OS can be in different states such as Ready, Running, Waiting (Blocked), or Terminated. The Ready state means that the thread is prepared to run and is waiting for CPU allocation.
The Kernel dispatcher maintains a Ready Queue, which contains all the ready threads. It selects one thread from this queue based on priority and assigns it the CPU.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.