Deadlock in os example1/7/2024 ![]() Assume, in a library there is only book of Operating System which is already taken by someone else, but you also want to read that, but you can’t. If one process using a resource, then other process cannot use it. If yes, then now we will study about necessary conditions which needs to be satisfied for Deadlock occurence.ĭeadlock can occur only when all the above 4 conditions will satisfy. I hope, you understand that What deadlock is ? In these case, Process is waiting for a resources while holding another resource which is needed by other process. Same happens in Deadlock also.Īssume, boy & girl as the processes and money & shoes as the resources. In these case both will wait for infinite time. So, in these case, both are not ready to give their products (i.e Shoes and Money), but they are waiting and thinking that “ I will give these shoes/money to him/her, only when he/she will give me that money/shoe to me “. Boy is not ready to give money until it get the shoes, similarly girl is also not ready to give shoes until it get money. In these song , Boy is asking for the shoes and girl is asking for the money. If yes, then you will understand these very easily and you will not forget it for for the very long time. So, have you ever hear the evergreen song “ Joote do paise lo “ from the movie “Hum aapke hai kaun “. Then these situation will be called as Deadlock.įor more clarification, let’s look into the real life example. If two or more processes are waiting for such an event ( i.e. When the work is done, then the process will release the resource, so that if needed tgen the same resource can be used by other process. Release : When use is completed then process releases the resource. Use : When Operating System allocates the resource to process, then the process can use it.īecause, if Operating System will give the privilege to use the resource to process itself, that process can engage all the resources for itself only. ![]() I.e If process is trying to use any resource, it cannot use directly, before these the process should ask the Operating System which is known as Request. Request : Process requests for a resource to Operating System. Keyboard, Mouse, Hard disk, Camera, Speaker ,Scanner, CPU, etc.), or software (Eg. Same happens in the case of Operating System also. ![]() What are the necessary conditions, which needs to be satisfied for the occurence of deadlock ?īefore studying about Deadlock, we need to know that, what is meant by resource ?Īs we know that for the survival of living being, there are some resources which we require.What are the operations done on resources ?.At the end of these article you will be able to answer the following questions : ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |