In which of the following scheduling policies doe context switching ne...
Context switching takes place when a process is preempted (forcefully) and another process goes into the running state. In FIFO and SJF (non- preemptive) techniques, the processes finishes their execution then only their context is switched to other processes.
View all questions of this test
In which of the following scheduling policies doe context switching ne...
Explanation:
In the given options, the scheduling policies are as follows:
1. Round-robin: In round-robin scheduling, each process is given a fixed time quantum to execute. When a time quantum expires, the currently executing process is preempted and moved to the end of the ready queue. This policy involves context switching as the processor switches between processes at regular intervals.
2. Shortest job first (non pre-emptive): In shortest job first scheduling, the process with the shortest burst time is executed first. Once a process starts execution, it is not preempted until it completes. Since there is no preemption, context switching does not occur in this policy.
3. Preemptive: Preemptive scheduling policies allow processes to be interrupted and moved out of the running state before they complete. This is usually based on priority or time quantum. Context switching is an essential part of preemptive scheduling as it involves moving the running process out and bringing another process in.
4. First-come-first-served: In first-come-first-served scheduling, the processes are executed in the order they arrive in the ready queue. Once a process starts execution, it is not preempted until it completes. Similar to shortest job first, there is no preemption in this policy, and hence, context switching does not occur.
Conclusion:
Considering the above explanations, the scheduling policies where context switching never takes place are:
- Shortest job first (non pre-emptive) - Option 2
- First-come-first-served - Option 4
Therefore, the correct answer is option 'D' - 2 and 4.