In this case, process P1 will be executed fully (i.e. Let's take the following two cases and also assume that the value of "a" is 10 initially Now, we have two processes P1 and P2 that needs to be executed. In the above, you can see that a process after doing some operations will have to read the value of "a", then increment the value of "a" by 5 and at last write the value of "a" in the memory. They are reading the variable and then updating the value to the variable and finally writing the data in the memory. Now, think of a situation where we have two processes and these processes are using the same variable "a". In an Operating System, we have a number of processes and these processes require a number of resources. Process Synchronization and Critical Section We will also look at the solutions to the critical section problem i.e. So, in this blog, we will learn about process synchronization and critical section. No two processes should be allowed to use the printer at the same instant of time. For example, if the system is having a printer, then this printer is shared with all the processes but at a time, only one process can use the printer. But one thing that should be kept in mind is that the resources are shared but it should not be used simultaneously by all the processes. So, for this, we have shared resources in our system that can be shared between these processes. These processes require various resources for their execution. In an Operating System, there are a number of processes that are ready to be executed at a particular instant of time.
0 Comments
Leave a Reply. |