difference between scheduler and dispatcher

CPU scheduling decision may take place when a process switches from a running state to the waiting State so what do we mean by running state and waiting state so a process has already begun its execution that means a process is already in hold of the CPU at that time we say that the process is in a running state and then what is a waiting

CPU Scheduler

CPU scheduler so we have been talking about CPU scheduling from the previous few lectures and we need to understand what a CPU scheduler is so by now we must already have a brief idea of what scheduling actually is so what is a CPU schedule so it says here when the CPU becomes idle the operating system must select one of the processes in the ready queue to be executed the selection process is carried out by the short-term scheduler or CPU scheduler the scheduler selects a process from the processes in the memory that are ready to execute and allocates the CPU to that process so from the name itself we can understand that CPU scheduler is the one who is going to select the process that will get the CPU for its execution so we know that scheduling means assigning the CPU to different processes for their execution so there may be many processes that are ready to be executed and are waiting to just get the CPU among those already processes the CPU scheduler is the one who will select which process will get the CPU in order to do its execution so what we will do it will select a process from the processes in the memory that are ready to execute and it will allocate the CPU to that process so that is a function of the CPU scheduler so similarly there is another thing that we need to know about and let’s see what that is so the second thing that we need to know about is the dispatcher now what is this dispatcher and what does it do the dispatcher is the module that gives control of the CPU to the process selected by the short-term scheduler

Dispatcher

so what does dispatcher does is that it will give the control of the CPU to the process that was selected by the CPU scheduler so we see that there are different number of processes waiting in memory to be executed they are ready to be executed that means they are ready to get the CPU so what the cpu scheduler does it will select one of the process and say that yes you are the one that is going to get the CPU to begin your execution and what is a dispatcher do dispatcher is a module that actually gives control of the CPU to that process that was selected by the CPU scheduler so we need to understand that this dispatcher has to be very quick because there are a lot of process switching that is taking place so we know that there are different processes waiting for the CPU and when one process is executing and when it goes into a waiting State we need to give the CPU to another process so this happens very frequently and the switching between these processes must happen very quickly so the dispatcher has to be very quick and so the time it takes for the dispatcher to stop one process and start another running is known as the dispatch latency so here is another term that we need to know about dispatched latency that is the time that the dispatcher takes for stopping one process and starting another one that means the time it takes for the dispatcher to switch the CPU between two processes that is what we mean by dispatch latency so we can know that in order to have a efficient computation we need to have minimal dispatch latency all right now since we have learned about these two terms CPU scheduler and dispatcher

Leave a Comment