How operating systems regain control from CPU-hogging processes
This question explores a fundamental challenge in operating-system design: what happens when a user-space process refuses to yield control back to the kernel. If a program loops indefinitely without making any system calls, it never executes a trap instruction that would normally transfer control to privileged kernel code. The OS must have a mechanism to interrupt such "non-cooperative" processes and enforce fair resource allocation.
To answer this, you need to understand the boundary between user mode and kernel mode, and how the OS can forcibly regain execution context without relying on the running process to cooperate. This is a core concern in any preemptive multitasking system, and firms ask it to test whether candidates grasp the hardware-software contract that makes modern operating systems possible.
- User mode vs. kernel mode and privilege levels
- Interrupt handling and timer interrupts
- Context switching and process scheduling
- Hardware support for preemption