![]() The algorithm may itself increase complexity and may also lead to poor resource utilization.Īs you saw already, most prevention algorithms have poor resource utilization, and hence result in reduced throughputs. To avoid circular wait, resources may be ordered and we can ensure that each process can request resources only in an increasing order of these numbers. The challenge here is that the resources can be preempted only if we can save the current state can be saved and processes could be restarted later from the saved state. ![]() In the second approach, if a process request for a resource which are not readily available, all other resources that it holds are preempted. If a process request for a resource which is held by another waiting resource, then the resource may be preempted from the other waiting resource. This may result in a starvation as all required resources might not be available freely always. Second approach is to request for a resource only when it is not holing any other resource. They could have been used by other processes during this time. This will avoid deadlock, but will result in reduced throughputs as resources are held by processes even when they are not needed. We will see two approaches, but both have their disadvantages.Ī resource can get all required resources before it start execution. Not always possible to prevent deadlock by preventing mutual exclusion (making all resources shareable) as certain resources are cannot be shared safely. ![]() However most prevention algorithms have poor resource utilization, and hence result in reduced throughputs. We can try to prevent or avoid deadlock, and if that doesn’t work out, we should detect deadlock and try to recover from deadlock.ĭeadlock prevention algorithms ensure that at least one of the necessary conditions (Mutual exclusion, hold and wait, no preemption and circular wait) does not hold true. You have already seen what deadlock is and the necessary conditions for a deadlock to happen. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |