Dispatch Latency and Context Switching

 These terms are both related to the Process Scheduling par t of the Operating System, basically Dispatch Latency is a time quantity(like the Rotational Latency in Disk Processing, which will be covered later in the Operating System Portion) and Context Switching is a Process. 

We just need to understand that this whole process starts because we wanna execute a Process(which is done in the RAM) so firstly we need to fetch the Process from the Secondary Memory where the Process is stored initially. And now we gotta select the Processes in some order, so how to do that, well, let's leave it to the STS(Short Term Scheduler) which just does the work of selecting Processes for execution.


Now, we have a process for execution but we need to transfer the control to this Process, so who is gonna do that? That is done by the Dispatcher, like the name suggests, it Dispatches! 

The role of the Dispatcher is that it firstly transfers control of CPU to the Process and then Does the Job of Context Switching(Just refer to the Context as information about a Process, which is maintained in the PCB Block so that when that Process is brought again for Execution then we can get to know that what was the previous state of Execution?).

We should know that Context Switching is a Overhead, means during this Process CPU doesn't do any work, means it is a wastage of Time, but for Multitasking this is a must, so cannot omit it.

Some of the Main Things stored in the Context of any Process are, Registers, Pointers, Program Counters, etc. Basically when we say that there was a Context Switching from the Process P1 to the Process P2, means, Dispatcher Transferred the control of the CPU to the P2 Process and the State(Context) of P1 was saved in the PCB and the state of P2 Process was retrieved from the PCB Block.

Comments

Popular Posts