 Dear students, we have discussed the distinction between program and process. Now we should discuss that how the process states are stored and where those states are stored. So this is studied under the process and its administration. So there are two very important modules. One is known as scheduler and another is known as dispatcher. So in one of the previous modules we discussed that these are very important components of operating system, functionalities of operating system which we are going to discuss now. So the scheduler maintains the record which process are present in the computer system. So for example if you have launched five applications or five processes so those five processes are available within the computer system and the scheduler maintains the record that these five are available and if some new process arrives that need to be put in this list and if some of the process from these list of five processes finishes its execution then that process will be excluded or removed from the list. So all of such scheduling of the processes is done by scheduler and then there are different schemes that how these processes will be scheduled. We learnt one thing in one of the previous module about first in first out. So that could be one of the strategy that any job which is coming first that need to be scheduled or executed first and there are number of other plans or approaches available for example short as job first, round robin etc which you will be learning in your operating system course. And then this scheduler maintains a process table in the main memory. So how it works there is a dedicated space in the main memory where this scheduler maintains the process table and what it store in that process table the name of the process the ID of the process and who has initiated this process priority of any process for example it could be that some processes are of highest priority that need to be executed first whether they have arrived later in the queue. So this could be one of an other approach to execute the processes. So it also store such priorities then it store what was the starting time when this process started its execution then what is the duration and very specifically what is the memory area where from where this process belongs because we also learn that any process cannot access the memory which does not belong to that particular process. So every process has its own dedicated memory and then current state of this process whether it is in ready state or in waiting state and then there is another term known as dispatcher. So this is another very important component of kernel in operating system and that oversees the process execution for example time sharing multi-programming multi-tasking time slice which are normally in milliseconds are in microseconds. So the scheduler have only scheduled that which process need to be executed at this time and now the dispatcher is taking care that the processes are given enough are proper time slots and after the time slot next process is being executed. So how it is done there is a term known as process switch or sometime it is called context switch. So it is a procedure of changing from one process to another process. So dispatcher awards a time slice to one process for example it says 10 milliseconds have been awarded to this process A and when those 10 milliseconds have elapsed then the next process should be initiated. So it generate an interrupt so that interrupt would mean that the control now should be transferred to process B of course after saving all of the process state of process A. So such a transfer is known as process switch and how it sees that the time has been elapsed it activates a timer. So whenever it gives the control or the CPU to any process it also initiate a time circuit so that is counting and as soon as that time circuit reaches the point which is equivalent to the time slice given to that process it the time circuit activates an interrupt. So this means that the control should be transferred to the next process and this interrupt is handled by interrupt handler when CPU receives an interrupt what it does it completes the current machine cycle saves the current process state which we have discussed and then begin executing the next program as interrupt handler. So what interrupt handler is doing it is basically part of dispatcher describe how the dispatcher should respond. One of the thing is it preempt the current process it takes forcefully the CPU from that process and that is known as preemption. And then transfer control back to the dispatcher and dispatcher selects the process from process table having highest priority and if it is there all of the priorities are same then whatever the process has arrived first that is selected from the ready queue time slice is given and the time circuit is again initiated. So this is basically a pictorial diagram for multi programming between process A and process B. So these are the time slice for which these processes are executing. So first of all process is executing and when it is executing the time circuit was activated and when the time slice is reached by the time circuit. So for example if 10 milliseconds were given so whenever that time circuit reaches up till 10 millisecond so that time circuit give a interrupt. So whenever there is interrupt there is a process switch which means save all of the state of this process and move to the process B and similarly process A process B. So this will be giving all of the equal time slices which have been discussed previously. So this is one of the way of multi programming between process A and process B. So if we conclude today's module we have learnt that how these processes are coordinated and what is the role of scheduler, dispatcher, what is context switch and how the interrupt is handled.