In non-preemptive scheduling, a process runs until it either voluntarily releases the CPU or completes its execution. However, even in non-preemptive scheduling, there are scenarios where context switching may occur involuntarily due to external events, such as when a process makes a system call that requires waiting for some event to complete, like reading from a file or waiting for user input. In these cases, the process might be temporarily blocked, allowing the operating system to switch to another ready process.
This kind of preemption in non-preemptive scheduling usually occurs during system calls or other situations where a process explicitly indicates that it's waiting for an event to happen. However, the level of hardware support required for such preemption is typically less complex than what's needed for preemptive scheduling algorithms, where time slices (quantums) are strictly enforced and processes can be forcibly preempted even if they're in the middle of their execution.