Consider a process running on a . Which one or more of the following events will always trigger a context switch by the that results in process moving to a non-running state (e.g., ready, blocked)?
View worked solution
Answer: A;B
To determine which events always force the running process into a non-running state (such as ready or blocked), let us analyze each option:
- Option A (Correct): A blocking system call means process cannot proceed until the requested disk I/O completes. The OS must move to the blocked state and context switch to another ready process.
- Option B (Correct): A page fault for a page in the swap space requires disk I/O to bring the page into main memory. Since disk access is slow, the OS blocks and context switches to another process to utilize the CPU. Thus, always moves to the blocked state.
- Option C (Incorrect): An interrupt for another process is handled by the Interrupt Service Routine (ISR). After the ISR finishes, the OS can resume the execution of directly if still has the highest priority, without moving to a non-running state.
- Option D (Incorrect): A timer interrupt triggers the scheduler, but if is the only ready process in the system, the scheduler will immediately resume . Thus, it does not always force to transition to a non-running state.
Free practice · Your answers on this page are not saved.
