 Hello everyone, today we are going to learn about process concept in operating system. The learning outcome of this session are, at the end of this session student will be able to define what is process, describe process states and process control block and explain what is context switch. Let us see the process. Why to study process? As we know, the early computer was able to execute only one process at a time. So that single process has the whole control on the operating system and its resources. But it gives very low performance of the computer. Nowadays, we require higher throughput so that the need of the operating system is maximum CPU utilization. Maximum CPU utilization means it must allow number of processes to be executed at a time in the system. This results in the nation of the process. So the process is nothing but program in execution. As we know, we can execute multiple processes like microprocessor world, web browser, music player at a time in the system. Each is nothing but the process. So process is nothing but program in execution and it is a unit of work in time sharing operating system. Process is more than program code because process contains program counter, processor register, process stack and data session. While the program is nothing but the set of instruction. So we can say that program is a passive entity whereas process is an active entity. Let us see what are different process states. As process executes, it changes its state. When process is newly created, its state is new. It shows that process is being created. Once process is created, it is admitted to the ready queue. Once it is admitted to the ready queue, now it is the task of scheduler to dispatch that process to the CPU. When that process is given to CPU, process enter its states from ready to running state. While running, interrupt may occur. To service that interrupt, process must switch from running state to ready state and operating system must service the interrupt. Similarly, while execution, input output event may occur. When an IO event occur, process must enter into the waiting state. When IO event completes, process enters from waiting state to the ready state. Then when process is in ready state, that process is schedule by scheduler and it can enter into the running state. When process completes its execution, its states is terminated. So all these are nothing but the process states from new to terminated. When process is created, its states was new and whenever process exit, its states was terminated. So this is nothing but the lifetime of the process and during its lifetime process undergoes in these different states. Now let us pause the video and define what is process and its lifetime. Does process states vary across operating system? Let us see what is process. Process is nothing but program in execution. As I already mentioned, the lifetime of the process is from its creation to termination. The second question was about the process states. Whatever the process states, we studied here that states are arbitrary and they vary across operating system. Means what? The different operating system may have different number of states. Whatever states we studied here that all states are arbitrary states of the processes. Now let us see about process control block. Process control block is also called as a task control block. Process control blocks contain the whole information about the process. If we have 4 processes running in the system, then we will have 4 process control blocks in the system. So we can say that there exist process control block per process in the system. Let us see the fields present in process control block. First field is pointer which points to the next PCB. As number of processes are present in the operating system, number of PCBs will be there. So pointer field is important in PCB which points to the next process control block of the process. Next field is process state. As we studied right now, the process states may be new, ready, running, waiting or terminated. The next field is process number. Each and every process in operating system have unique identification number. That number is stored in its process control block. Program counter, it gives the address of the next instruction to be executed. There are different registers, accumulator, index registers, stack pointer, general purpose registers. All these are used by the process when it is in execution. So the values of these registers are stored in process control block. Memory limits. It gives information about memory management, for example page tables, segment tables, etc. List of open files. It gives the list of files which are open by this process. Suppose you have a source code which contains file open function which open another file, then the process of this program will contain counter 1 for list of open files. Next is miscellaneous accounting and status data. This is nothing but the information about the usage of the CPU and the time constraint by the process. So as we can see here, the process control block contains each and every information about the process and this process control block is a dynamic structure because it gets changed as process executes and that is why process is called as an active entity. Let us see what is context switch. To understand the concept of context switch, here we will consider two processes exist in the system, process P0 and process P1. Now as there are two processes present in the system, there will be two process control blocks. Initially, suppose process P0 is in executing state, while execution interrupt may occur. So it is the task of operating system to service that interrupt or system call. So before servicing the interrupt or system call, operating system must save the state of process 0 into PCB 0 and as CPU never sit idle to get the maximum CPU utilization, operating system must reload the state of the process 1 from PCB 1. Now the process P0 enters from running state to waiting state and process P1 which was in ready state enters into the running state. Now as process P1 executes, interrupt or system call may occur. So now it is the task of operating system to service the interrupt. So it has to save the context of the process P1 into PCB 1 and it has to load the context of process P0 into PCB 0. So when operating system loads the context of process P0, process P0 starts executing and process P1 enters into the idle state. So as we can see here, whenever the process P0 was in execution, process P1 was in idle state, while when process P1 was in execution state, process P0 was in idle state and here saving the context of the process 0 and loading the context of process 1, this task of operating system is called as a context switch. Here operating system is switching from one process to another process. That is from process P0 to process P1, then from process P1 to P0. So this is nothing but the switching between two processes and this switching task is called as a context switch. So these are the references. Thank you.