online discussion -7 Version 0 |
|
👤 Author: by writer 2020-11-10 02:22:52 |
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
<p class="rtejustify"> Deadlock 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. However most prevention algorithms have poor resource utilization, and hence result in reduced throughputs.</p>
<p class="rtejustify">Not always possible to prevent deadlock by preventing mutual exclusion (making all resources shareable) as certain resources are cannot be shared safely.</p>
<p class="rtejustify"><span style="text-decoration: underline;">Hold and Wait:</span></p>
<p class="rtejustify"> We will see two approaches, but both have their disadvantages.</p>
<p class="rtejustify">A resource can get all required resources before it start execution. This will avoid deadlock, but will result in reduced throughputs as resources are held by processes even when they are not needed. They could have been used by other processes during this time.</p>
<p class="rtejustify">Second approach is to request for a resource only when it is not holing any other resource. This may result in a starvation as all required resources might not be available freely always.</p>
<p class="rtejustify"><span style="text-decoration: underline;">No preemption:</span></p>
<p class="rtejustify"> We will see two approaches here. 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. In the second approach, if a process request for a resource which are not readily available, all other resources that it holds are preempted.</p>
<p class="rtejustify">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.</p>
<p class="rtejustify"><strong>Circular wait</strong></p>
<p class="rtejustify">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 algorithm may itself increase complexity and may also lead to poor resource utilization.</p>
<p class="rtejustify"> <strong><span style="text-decoration: underline;">b) Difference between deadlock prevention and deadlock avoidance </span></strong></p>
<p class="rtejustify"> As you saw already, most prevention algorithms have poor resource utilization, and hence result in reduced throughputs. Instead, we can try to avoid deadlocks by making use prior knowledge about the usage of resources by processes including resources available, resources allocated, future requests and future releases by processes. Most deadlock avoidance algorithms need every process to tell in advance the maximum number of resources of each type that it may need. Based on all these info we may decide if a process should wait for a resource or not, and thus avoid chances for circular wait.</p> PostVer 0
Please login to reply. Login