First off, take a single processor system with multiple processes running in pseudo-parallel. When a process triggers a page fault, will this force the CPU to stop executing all programs until the page is loaded from disk?
If so, does this change on a multi-core or multiprocessor system, or can the other processes continue to read and write to memory while the page fault is dealt with?
Thanks!
First, scheduling does not work for processes but for threads. A page fault only suspends the thread incurring the fault (on Linux and Windows). The thread is descheduled and the CPU is free to do other work.
At the level of the OS interfacing hardware there is no synchronous IO anyway. It does not exist (at least with modern hardware). The OS does not sit in a tight spin-loop waiting for the hardware to signal IO completion. Instead, the thread is descheduled until the IO completed (or the respective wait handle becomes signaled).
Yes, this is not a problem at all. Nobody in their right mind designs a multi-process OS that's unable to run multiple processes, nor would they arbitrarily block process A because B is waiting on a disk I/O.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With