Process Control Block in Operating System

in this lecture we’ll be studying about process control block so first of all let us see what is this process control block let us try to understand what are the uses of this process control block as far as the process is concerned so it says each process is represented in the operating system by a process control block abbreviated as PCB and it is also called a task control block so process control block is something that we use to represent a particular process in the operating system so let us take an example diagram to see how the process control block looks like and let us see what are the things we have in the process control block which helps us to represent that process in the operating system so this diagram given here is the example of a process control block so we have things like process state process number process counter registers memory limits list of open files.
An example diagram showing a process control block and what are the things present in the process control block so now let us see one by one what are the things we actually have in a process control block and let us see what does those things represent or tell about the process in an operating system so the first thing that we have is a process ID so process ID or process number as it is given in this example it shows the unique number or unique ID of a particular process so every process has to be represented by a unique ID which will identify that process so this process ID is the unique number or identification that identifies a particular process and this is one of the things that is present in a process control block which is used to represent a particular process now the next one that we have is process State so what is process state process state tells us the particular state in which a process is at that particular moment now in the previous lectures we studied about process State and we saw that a process can be in different states like the new state running state waiting state terminated State and so on so this process state will tell in which of those states is the process in at that particular moment so this is also another thing that is there in the process control blog which will represent a particular process so the next one that we have is a program counter so the program counter.
It indicates the address of the next instruction that has to be executed for that particular process now let me explain what this means now we already studied that a process is a program in execution when a program is in execution at that moment we call it a process so when a process is being executed the lines of instructions or the lines of codes are executed line by line now when it is being executed this program counter tells us the address of the next line of instruction that has to be executed so we have lines of instructions that are being executed and at a particular moment what is the address of the next line that has to be executed that is given by the program counter so the program counter indicates the address of the next line of instruction that has to be executed for a particular process all right so the next one that we have is CPU registers so CPU registers it tells us the registers that are being used by a particular process so there are different kind of registers like the index registers stack pointers general-purpose registers and so on so this CPU registers will tell us the particular registers that are being used by a particular process so this is also another thing that we have in the process control block so the next one that we have is CPU scheduling information so the CPU scheduling information has the priority of the processes it has the pointer to the scheduling queue and also other scheduling parameters now scheduling is a very important topic as far as operating system is concerned and there will be a whole topic regarding it which we will be discussing later but for now let me give you a brief idea of what shadowing is so we know that there are many processes that are waiting to be executed.
It’s not only one process but there are many processes that are waiting to be executed socha dueling determines which process has to be executed first or it determines the order in which the processes has to be executed so there may be processes with higher priority than other processes so they may have to be executed first and also when processes are all waiting in a queue it has to be determined how much time has to be allotted to a particular process and all those kind of things are determined by the scheduling algorithms so that is what we mean by scheduling and so the CPU scheduling information is also stored in the process control block it is not shown in this example over here but this is also another thing that we have in the process control block now next we have the memory management information so the memory management information from the name itself you must have understood it represents the memory that is being used by a particular process so different aspects of the memory all those information regarding that will be stored in the memory management information and that is another thing that is stored in the process control block now next we have accounting information so this is also not shown in this example but we have the accounting information so accounting information keeps an account of certain things like the resources that are being used by the particular process so there are different resources that are used by the process like it can be CPU it can be time it can be memory and so on so accounting information it keeps an account of all those resources that are being used by a particular process for its execution so this is also another thing that is there in the process control block and it is used to represent the process and lastly we have the input/output status information so input/output stage information represents the input/output devices that are being assigned to a particular process so a process during its execution may need to use some of the input/output devices so which are the input/output devices assigned to a particular process that information is stored in the input/output status information and this is also a part of the process control block so we see that all these things over here they can represent our process they represent the different aspects of a particular process and all these things together they are in a block known as the process control block and hence we see that the process control block is used to represent a particular process in the operating system.

Leave a Comment