A: True
If a process itself makes a block() call, then it will be blocked until the I/O operation completes.
B: True
If a page is not in the physical memory, then the OS invokes the Page Fault Handler, and the process remains blocked until the page is read (i.e., the disk I/O is complete).
By the way, there are two types of page faults:
- Minor Page Fault: Occurs when a page is already in physical memory but was brought in earlier by another process, and the current process is not aware of it. This typically happens when pages are shared.
- Major Page Fault: Occurs when the OS needs to access the disk to retrieve the page into physical memory.
Since this question refers to retrieving a page from the disk, it is considered a Major Page Fault. Therefore, the current process will be blocked until this I/O operation is completed.
References: Wikipedia: Page Fault, One more: Stack Overflow Discussion
C: False
Such a request will be served by DMA (Direct Memory Access), and the CPU does not need to get involved. Hence, the current program will continue using the CPU.
D: False
Timer interrupts may be ignored in many cases and do not necessarily lead to a context switch.
- Case 1: Consider non-preemptive scheduling like FCFS. In that case, we either disable the timer interrupt or ignore it.
Reference: (Q8) IITB OS Notes - Case 2: Consider a scheduling algorithm such as RR with Priority. Suppose we want to run process \( P_1 \) (high-priority) for a quantum of 50 ms and \( P_2 \) (low-priority) for a quantum of 10 ms.
Then, the timer interrupt interval should be:
\[ \text{Timer Interval} = \gcd(10, 50) = 10 \text{ ms} \]
Now, whenever \( P_1 \) is running and a timer interrupt occurs, it will be ignored four times and a context switch will occur on the fifth occurrence. Therefore, it is clear that it is not necessary to perform a context switch on every timer interrupt.