0% found this document useful (0 votes)
39 views

Opearating System (OS) BCA Question Answers Sheet Part 3

There are four main methods for handling deadlocks: 1) Deadlock ignorance ignores deadlocks and restarts processes, which decreases performance. 2) Deadlock prevention designs systems to prevent deadlocks from occurring. 3) Deadlock avoidance allows processes to declare maximum resource demands to avoid conditions that could cause deadlocks before they occur. 4) Deadlock detection finds and resolves deadlocks after they occur.

Uploaded by

xiayo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Opearating System (OS) BCA Question Answers Sheet Part 3

There are four main methods for handling deadlocks: 1) Deadlock ignorance ignores deadlocks and restarts processes, which decreases performance. 2) Deadlock prevention designs systems to prevent deadlocks from occurring. 3) Deadlock avoidance allows processes to declare maximum resource demands to avoid conditions that could cause deadlocks before they occur. 4) Deadlock detection finds and resolves deadlocks after they occur.

Uploaded by

xiayo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Q-1. What methods are used for handling deadlock?

A-1. There are mainly four methods for handling deadlock.

1. Deadlock ignorance- It is the most popular method and it acts as if no deadlock and the user will
restart. As handling deadlock is expensive to be called off a lot of codes need to be altered which will -
decrease the performance so for less critical jobs deadlock are ignored. Ostrich algorithm is used in
deadlock Ignorance. Used in windows, Linux etc.

2. Deadlock prevention- It means that we design such a system where there is no chance of having a
deadlock.

3. Deadlock avoidance- Here whenever a process enters into the system it must declare maximum
demand. To the deadlock problem before the deadlock occurs. This approach employs an algorithm to
access the possibility that deadlock would occur and not act accordingly. If the necessary condition of
deadlock is in place it is still possible to avoid feedback by allocating resources carefully.

Q-2. Explain the 4 conditions of deadlock handling.

A-2. (a) Mutual exclusion: It can’t be resolved as it is the hardware property. For example, the printer
cannot be simultaneously shared by several processes. This is very difficult because some resources are
not sharable.

(b) Hold and wait: Hold and wait can be resolved using the conservative approach where a process can
start it and only if it has acquired all the resources.

(c) Active approach: Here the process acquires only requires resources but whenever a new resource
requires it must first release all the resources.

(d) Circular wait: In order to remove circular wait, we assign a number to every resource and the process
can request only in the increasing order otherwise the process must release all the high number
acquires resources and then make a fresh request.
Q-3. Why is prevention not a practical solution to deadlocks?

A-3. Delays process initiation

Processes must know future resource need

Pre-empts more often than necessary

Dis-allows incremental resource requests

Inherent preemption losses.

Q-4. What is the difference between deadlock prevention and deadlock avoidance?

A-4.
Q-5. What are three methods of recovery from deadlock? Explain.

A-5.
Deadlock Recovery through Preemption- The ability to take a resource away from a process, have
another process use it, and then give it back without the process noticing. It is highly dependent on the
nature of the resource. Deadlock recovery through preemption is too difficult or sometime impossible.

Deadlock Recovery through RollBack- In this case of deadlock recovery through rollback, whenever a
deadlock is detected, it is easy to see which resources are needed.To do the recovery of deadlock, a
process that owns a needed resource is rolled back to a point in time before it acquired some other
resource just by starting one of its earlier checkpoints.

Deadlock Recovery through Killing Processes- This method of deadlock recovery through killing
processes is the simplest way of deadlock recovery.Sometime it is best to kill a process that can be
return from the beginning with no ill effects.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy