HimachalSpider.com


ForumResourcesHimachal Pradesh InfoBusiness DirectoryCelebritiesEntrance ExamsQuestion BankHimachal MatrimonialsJobs in Himachal PradeshCommunities


Subscribe to Email
  • Job alert
  • Forum posts by Email
  • Explore Rajasthan


  • My Profile

    Advertise Here

    Awards & Gifts


    Active Members
    Today
      Last 7 Daysmore...



      free counters




      Resources » Knowledge Sharing » Computer Knowledge


      Deadlocks


      Posted Date:     Category: Computer Knowledge    
      Author: Member Level: Diamond    
      Rating: 2 out of 52 out of 5Points: 20


      Defining Deadlocks



      When we study about a multi-programming system, there are several processes being performed every now and then. Each process requires some resources which it utilizes to accomplish the task. It may happen that when a process requests the resources, the required resources are not available at that particular moment. As such, the process will enter the wait state, until its resources are available. It may also happen that the process is never able to change from the wait state as the resources requested by it are held by other waiting processes. Thus there exists a cycle of waiting processes, with one process holding the resources required by another. This particular condition is known as the deadlock.



      In general there are three operations involved with a process:

      1.Request:

      Whenever a process requires a resource, it makes a request for it. If the resource is available at that particular moment, it is granted to it. However, if the resource is not available, the process has to wait.

      2.Utilize:

      Once the resource has been requested to the process, it must use the resource fully in order to accomplish the task.

      3.Release:

      After the completion of the task, the process releases the resource so that it is available for other processes now.



      Essential conditions for Deadlocks:



      1.Mutual Exclusion:

      At any point of time a resource must be accessed by only one process. Any other process requesting for it, must enter the wait state. The process which has been granted the resource must use it before it can be granted to any other process. This exclusive access to a resource by a single process at a time is called mutual exclusion.

      2.Hold and Wait:

      It says that a process must be holding at least one resource and at the same time waiting for more resources which are in turn held by other waiting processes.

      3.No Preemption:

      The literal meaning of word preempt is ‘take the place of or have precedence over.’ It means that no process should release the resource unless it has been completely used by it. A process can voluntarily release the resource after it has fully utilized it.

      4.Circular Wait:

      It says that all the waiting processes in a deadlock must form a cycle. There should exist a set (P1,P2,P3,…… Pk) of processes such that process P1 is waiting for the resources held by process P2, process P2 is waiting for the resources held by process P3, process and in the end process Pk is waiting for the resources held by process P1.



      Handling Deadlocks:



      There are three ways to handle the deadlocks:

      1.Prevention and Avoidance of the deadlocks.
      2.Allowing the deadlocks to occur and then detecting and correcting them consequently.
      3.Assuming that deadlocks never occur in the system and ignoring them.


      Did you like this resource? Share it with your friends and show your love!








      Responses to "Deadlocks"
      Author: Arun Sharma    10 Dec 2010Member Level: Bronze   Points : 0
      Give example for it With breif illustration



      Feedbacks      

      Post Comment:




    • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
    • No HTML formatting and links to other web sites are allowed.
    • This is a strictly moderated site. Absolutely no spam allowed.
    • Name:   Sign In to fill automatically.
      Email: (Will not be published, but required to validate comment)
      Website: We will link to your website, if the comment is worth keeping!



      Type the numbers and letters shown on the left.


      Previous Resource: Networking
      Return to Resources
      Post New Resource
      Category: Computer Knowledge


      Post resources and earn money!
       
      Popular Tags   Tag posting guidelines   Search Tags  
      Deadlocks  .  Mutual exclusion  .  

      Online Memberssatish shara
      More...

      Bookmark and Share

      Top Himachalspider Earners HimachalSpider.com provides an opportunity for members to earn some money while spending their time in this website. Read more about making money.

      Top Earners

    • Adonis: Rs 11332.00
    • Vaishno P Vashisht: Rs 3426.00
    • Narender sharma: Rs 1851.00
    • Hemant Singh Kanwar: Rs 1532.00
    • Nishant Sharma: Rs 1326.00

    • Areas
    • Bilaspur (hp)
    • Chamba
    • Hamirpur(hp)
    • Kangra
    • Kinnaur
    • Kullu
    • Lahul & Spiti
    • Mandi
    • Shimla
    • Sirmaur
    • Solan
    • Una



    • About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    Revenue Sharing sites   Advertise   Talk to Tony John
      Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
      2005 - 2011 All Rights Reserved.