Dispatcher is a special program which comes into play after scheduler. When scheduler completed its job of selecting a process, then after it is the dispatcher which takes that process to the desired state/queue. The dispatcher is the module that gives control of the CPU to the process selected by the short-term scheduler. This function involves the following:
- Switching context
- Switching to user mode
- Jumping to proper location in user program to restart that program
As we are now dealing with the another process and earlier the short term scheduler was involved i.e the control was with the CPU so in order to execute the process the control must now be given to the user So it makes 2 correct.(For instance If it continues to execute in the priviliged mode how will the user interactive processes work?)
Maybe that process was preemptied or It is started so we have to jump to the proper location in order to restart the working of the program . So this also needs to be taken care of by the dispatcher.