Deadlock Prevention, Avoidance, Detection & Recovery in Operating System

Operating System · Chapter 19

Deadlock Prevention, Avoidance, Detection & Recovery in Operating System

Once we understand how a deadlock is created, the next question is: How should an operating system deal with it? The system can stop deadlock from becoming possible, carefully avoid dangerous resource allocations, allow deadlock and detect it later, or recover after deadlock has already occurred.

These approaches are called Deadlock Prevention, Deadlock Avoidance, Deadlock Detection and Deadlock Recovery. They sound similar, but they work at completely different stages. This chapter explains each method, safe and unsafe states, Banker's Algorithm, detection algorithms, process termination, resource preemption, rollback and victim selection in simple language.

Quick Answer: Deadlock prevention stops at least one necessary deadlock condition from being possible. Deadlock avoidance examines resource requests before granting them and keeps the system in a safe state. Deadlock detection allows allocations to occur and later checks whether a deadlock exists. Deadlock recovery acts after detection by terminating processes, preempting resources, rolling processes back, or using a combination of these methods.
DEADLOCK DEFENSE COMMAND CENTER
1 Prevention Break one necessary condition before deadlock can form.
2 Avoidance Grant requests only when the state remains safe.
3 Detection Allow allocation and later check whether deadlock exists.
4 Recovery Break an existing deadlock after it is detected.

How Can an Operating System Handle Deadlock?

Deadlock Prevention, Avoidance, Detection & Recovery in Operating System

There is no single deadlock-handling method that is perfect for every system. Different approaches make different trade-offs between safety, performance, resource utilization and implementation cost.

Deadlock Prevention

Change resource-allocation rules so that at least one of the four necessary deadlock conditions cannot hold.

Idea: Make deadlock structurally impossible.

Deadlock Avoidance

Examine each new request and grant it only when the resulting allocation leaves the system in a safe state.

Idea: Do not enter a dangerous state.

Deadlock Detection

Do not try to prevent every dangerous allocation. Instead, periodically check whether processes have actually become deadlocked.

Idea: Allow first, inspect later.

Deadlock Recovery

Once deadlock is detected, take action that breaks the circular dependency.

Idea: Restore progress after failure.

Deadlock Prevention in Operating System

Deadlock Prevention works by ensuring that at least one of the four necessary conditions for deadlock can never occur.

Recall the four conditions:

Mutual Exclusion · Hold and Wait · No Preemption · Circular Wait

Deadlock Prevention Definition:
Deadlock prevention is a method in which the resource-allocation rules are designed so that at least one necessary condition for deadlock is always false.
DEADLOCK CONDITION BREAKER
1
Break Mutual Exclusion

Make resources shareable whenever possible.

Example: allow multiple processes to read the same read-only file.
2
Break Hold and Wait

Do not allow a process to hold resources while waiting for additional resources.

Request everything before execution, or release held resources before requesting more.
3
Break No Preemption

When practical, force a process to give up some resources if its new request cannot immediately be satisfied.

The process can retry later after resources become available.
4
Break Circular Wait

Define a fixed global ordering for resource types and require processes to request resources only in that order.

Example: always request R1 before R2 before R3.

1. Preventing Mutual Exclusion

Mutual exclusion exists when only one process can use a resource instance at a time.

One prevention idea is to make resources shareable.

However, this is only possible for resources that are naturally safe to share.

Important limitation: We cannot simply remove mutual exclusion from every resource. A mutex lock, exclusive hardware device or writable critical data may genuinely require exclusive access.

Therefore, breaking mutual exclusion is useful only for suitable shareable resources.

2. Preventing Hold and Wait

Hold and Wait occurs when a process already owns one or more resources while waiting for additional resources.

A system can prevent this in two common ways.

Method A: Request Everything Together

A process declares and requests all required resources before it begins the resource-dependent work.

Method B: Release Before Requesting More

A process must release what it already holds before requesting another unavailable resource.

Problem With This Method

A process may reserve resources long before it actually needs them. Those resources remain unavailable to other processes.

Resource utilization can therefore become poor.

A process that repeatedly fails to obtain all required resources may also experience long delays or starvation.

3. Breaking the No Preemption Condition

Another strategy is to make selected resources preemptable.

Suppose Process P1 holds R1 and requests R2. R2 is unavailable.

Instead of letting P1 keep R1 while it waits, the system may require P1 to release eligible resources and try again later.

But this is not practical for every resource. Some resources cannot be safely taken away in the middle of an operation. For example, forcefully interrupting certain device or lock operations may leave data or hardware state inconsistent.

4. Preventing Circular Wait With Resource Ordering

Circular Wait can be prevented by assigning each resource type a fixed number or order.

Processes must then request resources only in increasing order.

Global Resource Order
R1
Order 1
R2
Order 2
R3
Order 3
R4
Order 4

A process may request:

R1 → R2 → R4

but it should not hold R4 and then request R2.

Because every process moves in the same resource-order direction, a circular resource dependency cannot form.

Advantages and Limitations of Deadlock Prevention

Advantages

Deadlock is prevented by design.

The logic can be easier to reason about than allowing deadlock and repairing it later.

Limitations

Prevention rules can reduce resource utilization, concurrency and flexibility.

Some conditions, especially mutual exclusion and no preemption, cannot be removed for every resource.

Deadlock Avoidance in Operating System

Deadlock Avoidance takes a different approach.

Instead of permanently breaking one deadlock condition, the operating system examines resource requests before granting them.

The request is granted only if the resulting system state remains safe.

Deadlock Avoidance Definition:
Deadlock avoidance is a dynamic resource-allocation method that grants requests only when the allocation keeps the system in a safe state.

What Information Is Needed?

Avoidance normally requires the system to know something about the maximum possible resource demand of each process in advance.

That information allows the operating system to ask:

“If I grant this request now, can all processes still finish in some order?”

Safe State, Unsafe State and Deadlocked State

Safe State

At least one order exists in which every process can obtain the resources it still needs, finish, and release its resources.

Unsafe State

The operating system cannot guarantee that all processes can finish using the remaining resources and declared maximum demands.

Deadlocked State

Processes are already permanently blocked by resource dependencies.

Very important: Unsafe state does not automatically mean deadlock. It means the system has entered a state where deadlock may become possible depending on future requests.

What Is a Safe Sequence?

A safe sequence is an order of processes in which every process can receive its remaining required resources, complete, and release what it holds.

EXAMPLE SAFE SEQUENCE
P1
P3
P4
P0
P2

If at least one safe sequence exists, the state is considered safe.

Resource Allocation Graph Algorithm for Deadlock Avoidance

When each resource type has only one instance, a Resource Allocation Graph can be extended for deadlock avoidance.

In addition to normal request and assignment edges, the system may represent a claim edge.

A claim edge means:

“This process may request this resource later.”

Before converting a request into an actual assignment, the operating system checks whether the new graph would create an unsafe cycle.

For multiple resource instances, the most famous avoidance method is Banker's Algorithm.

Banker's Algorithm in Operating System

Banker's Algorithm is a deadlock-avoidance algorithm for systems with multiple instances of resource types.

The name comes from the idea of a banker who lends money only when the banker can still satisfy all customers eventually.

BANKER'S ALGORITHM CONTROL DESK Check whether granting resources keeps the system safe
Available Number of free instances of each resource type.
Allocation Resources currently allocated to each process.
Max Maximum resources each process may require.
Need Remaining possible resource requirement. Need = Max − Allocation
Work Temporary available-resource vector used in the safety test.
Finish Shows whether a process can complete in the simulated sequence.

Banker's Algorithm Solved Example

Assume the system has five processes: P0, P1, P2, P3 and P4.

There are three resource types: A, B and C.

Current Available vector:

Available = (3, 3, 2)

Allocation Matrix

Process A B C
P0010
P1200
P2302
P3211
P4002

Maximum Demand Matrix

Process A B C
P0753
P1322
P2902
P3222
P4433

Step 1: Calculate Need Matrix

Use:

Need = Max − Allocation

Process Need A Need B Need C
P0743
P1122
P2600
P3011
P4431

Safety Algorithm Step by Step

The safety algorithm checks whether the current allocation state is safe.

1
Set: Work = Available.
Initially: Work = (3, 3, 2).
2
Set Finish[i] = false for processes that still need to be checked.
3
Find a process whose Need ≤ Work. That process could theoretically receive what it still needs and finish.
4
After that process finishes in the simulation, return its currently allocated resources:

Work = Work + Allocation
5
Mark that process finished and repeat until either all processes can finish or no suitable process remains.

Finding the Safe Sequence

SAFETY ALGORITHM SIMULATION
Start Work = 3,3,2
P1 Need = 1,2,2
P3 Need = 0,1,1
P4 Need = 4,3,1
P0 → P2 Both later finish

P1 Can Finish First

P1 Need: (1,2,2)

Current Work: (3,3,2)

Since:

(1,2,2) ≤ (3,3,2)

P1 can finish.

P1 returns its Allocation: (2,0,0).

New Work:

(3,3,2) + (2,0,0) = (5,3,2)

P3 Can Finish Next

P3 Need: (0,1,1)

It fits within Work: (5,3,2).

P3 releases Allocation: (2,1,1).

New Work: (7,4,3).

P4 Can Now Finish

P4 Need: (4,3,1)

This is less than or equal to: (7,4,3).

P4 releases: (0,0,2).

New Work: (7,4,5).

P0 Can Finish

P0 Need: (7,4,3)

Work: (7,4,5)

So P0 can finish.

New Work after P0 releases its allocation: (7,5,5).

P2 Can Finish Last

P2 Need: (6,0,0)

Work: (7,5,5)

So P2 can also complete.

ONE VALID SAFE SEQUENCE
P1
P3
P4
P0
P2
Result: Because a safe sequence exists, the current state is safe.

Resource-Request Algorithm in Banker's Algorithm

The safety algorithm tells us whether a state is safe.

But when a process makes a new request, the operating system must decide whether to grant it.

1 Check Request ≤ Need

A process should not request more than its declared remaining maximum requirement.

2 Check Request ≤ Available

Enough free resource instances must currently exist.

3 Pretend + Safety Test

Temporarily allocate the request and run the safety algorithm.

Simple Request Example

Suppose P1 requests:

Request1 = (1,0,2)

P1 Need is: (1,2,2).

So:

(1,0,2) ≤ (1,2,2)

Available is: (3,3,2).

And:

(1,0,2) ≤ (3,3,2)

The operating system can temporarily grant it.

New Available becomes:

(2,3,0)

New P1 Allocation becomes:

(3,0,2)

New P1 Need becomes:

(0,2,0)

The safety algorithm can still find a safe sequence, so this request can be granted.

Advantages and Limitations of Banker's Algorithm

Advantages

Prevents the system from entering unsafe allocation states.

Gives a clear mathematical method for reasoning about multiple resource instances.

Limitations

Processes must declare maximum possible resource requirements in advance.

Resource counts and process sets may change dynamically in real systems.

Repeated safety checks add overhead.

Deadlock Detection in Operating System

A system may decide not to prevent or avoid every dangerous allocation.

Instead, it can allow processes to request resources more freely and periodically run a deadlock detection algorithm.

Deadlock Detection Definition:
Deadlock detection is the process of examining the current allocation and waiting relationships to determine whether a deadlock already exists.
Single Instance Per Resource Type A Wait-for Graph can be used. A cycle indicates deadlock.
DETECT
Multiple Resource Instances A matrix-based detection algorithm examines Available, Allocation and current outstanding Request information.

Deadlock Detection With Wait-for Graph

When each relevant resource type has one instance, a Wait-for Graph can directly show process dependencies.

Example Waiting Cycle
P1
P2
P3

Suppose the complete dependency is:

P1 → P2 → P3 → P1

That creates a cycle in the wait-for graph.

Single-instance rule: A cycle in the Wait-for Graph indicates that the processes in the cycle are deadlocked.

Deadlock Detection Algorithm for Multiple Resource Instances

When resource types can have several instances, cycle detection alone is not enough.

A detection algorithm can use:

Available, Allocation and Request.

Important difference from Banker's Algorithm: Banker's avoidance algorithm uses each process's maximum remaining Need. Detection uses the process's current outstanding Request.
1
Set: Work = Available.
2
Initialize Finish values. Processes with no allocated resources may be treated differently according to the algorithm form being used; processes holding resources must be checked.
3
Find a process Pi for which: Finish[i] = false and Request[i] ≤ Work.
4
Pretend that Pi finishes and releases its resources:

Work = Work + Allocation[i]
5
Mark Finish[i] = true and repeat.
6
At the end, any process that still has Finish[i] = false belongs to the detected deadlocked set.

Deadlock Detection Algorithm in Pseudocode

Work = Available For every process Pi: if Allocation[i] == 0: Finish[i] = true else: Finish[i] = false Repeat: Find Pi such that: Finish[i] == false AND Request[i] <= Work If such Pi exists: Work = Work + Allocation[i] Finish[i] = true Until no more process can be selected If Finish[i] == false for any process: that process is part of the detected deadlocked set
The exact representation can vary between textbooks, but the main idea remains the same: simulate which blocked processes could eventually finish using currently available resources plus resources released by other finishable processes.

How Often Should Deadlock Detection Run?

Running a detection algorithm continuously can create unnecessary overhead.

Running it too rarely can allow many processes to remain stuck for a long time.

A system may consider factors such as:

Deadlock Frequency How often does the workload realistically create deadlock?
Detection Cost How expensive is the detection algorithm?
Blocked Processes How many processes are waiting unusually long?
Resource Utilization Are important resources locked inside blocked processes?

Deadlock Recovery in Operating System

Detection only tells the system that deadlock exists.

The operating system must still break the deadlock. This stage is called Deadlock Recovery.

Deadlock Recovery Definition:
Deadlock recovery is the set of actions used to break an existing deadlock and allow the system to make progress again.

Process Termination

Terminate one or more processes involved in the deadlock.

Resource Preemption

Temporarily take selected resources away from one process and allocate them elsewhere when this can be done safely.

Recovery by Process Termination

The simplest recovery idea is to terminate processes involved in the deadlock.

Option 1: Terminate All Deadlocked Processes

The deadlock is broken immediately because all resources held by those processes are released.

But a large amount of completed work may be lost.

Option 2: Terminate One Process at a Time

Select one victim, terminate it and check whether the deadlock disappears.

If not, terminate another victim.

This may preserve more work but requires repeated detection checks.

How Is a Victim Process Selected?

If the operating system does not want to terminate every deadlocked process, it needs a way to select a victim.

Process Priority Is the process high priority or low priority?
Work Completed How much useful work has already been done?
Work Remaining How much longer would the process need?
Resources Held How many useful resources would termination release?
Resources Still Needed Will the process require many additional resources?
Process Type Is it interactive, batch or otherwise important?

Recovery by Resource Preemption

Instead of terminating a process, the operating system may attempt to preempt selected resources.

Resource preemption means temporarily taking a resource from one process and giving it to another process so that the circular dependency can be broken.

Select Victim Choose a process or resource to preempt.
Rollback Restore process state if necessary.
Restart Allow the victim to continue later.

What Is Rollback in Deadlock Recovery?

If a resource is taken away from a process, simply continuing from the middle may not always be safe.

The process may need to return to an earlier consistent state. This is called rollback.

Checkpoint idea: If the system saves checkpoints of process state, it may restore a victim process to an earlier checkpoint instead of restarting the whole process from the beginning.

Starvation During Deadlock Recovery

Suppose the same process is always chosen as the victim because it has low priority or low recovery cost.

That process may repeatedly lose resources or repeatedly roll back.

It may never finish.

This becomes a form of starvation.

A recovery policy should consider how many times a process has already been selected as a victim so that the same process is not punished forever.

Deadlock Prevention vs Deadlock Avoidance

Point Prevention Avoidance
Main Idea Break a necessary deadlock condition Grant resources only if the state remains safe
Maximum Demand Information Not always required Usually required
Resource Utilization Can be reduced by strict rules Can be better than strict prevention
Decision Style Static restrictions Dynamic safety checks
Example Global resource ordering Banker's Algorithm

Prevention vs Avoidance vs Detection vs Recovery

Method When It Acts Main Idea Typical Example
Prevention Before deadlock can form Break a necessary condition Resource ordering
Avoidance Before granting each risky request Stay in a safe state Banker's Algorithm
Detection After allocations are allowed Check whether deadlock exists Wait-for Graph / detection matrices
Recovery After deadlock is detected Break existing dependency Termination or resource preemption

Which Deadlock Handling Method Should Be Used?

The choice depends on the type of system and the cost of deadlock.

If Deadlock Must Be Structurally Impossible Prevention may be useful.
If Maximum Demand Is Known Avoidance may be possible.
If Deadlock Is Rare Detection and recovery may be cheaper than continuous restrictive checks.
If Recovery Is Very Expensive Prevention or avoidance becomes more attractive.
Real systems often use a mixture of techniques rather than one universal strategy for every possible resource.

Common Mistakes Students Make

×
Thinking prevention and avoidance are the same.
Prevention breaks a necessary condition. Avoidance dynamically checks whether resource allocation keeps the state safe.
×
Thinking unsafe state means deadlock already exists.
Unsafe means deadlock cannot be ruled out. Deadlocked means progress is already blocked.
×
Using Allocation instead of Need in Banker's safety test.
The test compares remaining Need against current Work.
×
Forgetting Need = Max − Allocation.
Need represents how many more resources a process may still require.
×
Thinking one failed process choice proves an unsafe state.
Another process may satisfy Need ≤ Work and provide a valid safe sequence.
×
Confusing deadlock avoidance with detection.
Avoidance acts before allocation. Detection looks for deadlock after allocations exist.
×
Confusing Need and Request in the detection algorithm.
Detection considers current outstanding requests, not declared maximum future demand.
×
Thinking recovery always means terminating every process.
Systems can also terminate selected victims, preempt resources or use rollback.

Complete Deadlock Handling Flow in Simple Words

1
Prevention: design rules that stop one necessary deadlock condition.
2
Avoidance: examine a request and grant it only when a safe sequence remains possible.
3
Detection: if risky allocations are allowed, periodically check whether deadlock exists.
4
Recovery: break detected deadlock using process termination, resource preemption or rollback.

Deadlock Handling Exam Preparation

OPERATING SYSTEM · CHAPTER 19 · EXAM MODE

For a 2-Mark Question

Answer: Deadlock can be handled through prevention, avoidance, detection and recovery. Prevention breaks a necessary deadlock condition, avoidance keeps the system safe, detection identifies an existing deadlock, and recovery breaks that deadlock.

For a 5-Mark Question

Explain:

  1. deadlock prevention
  2. deadlock avoidance
  3. safe and unsafe state
  4. deadlock detection
  5. deadlock recovery

For a 10-Mark Question

Write in this order:

  1. methods of handling deadlock
  2. prevention of Mutual Exclusion
  3. prevention of Hold and Wait
  4. resource preemption
  5. resource ordering to prevent Circular Wait
  6. deadlock avoidance
  7. safe, unsafe and deadlocked states
  8. Banker's Algorithm
  9. safety algorithm
  10. resource-request algorithm
  11. deadlock detection
  12. Wait-for Graph
  13. multiple-instance detection algorithm
  14. process termination
  15. resource preemption, rollback and victim selection

For a Banker's Algorithm Numerical

Golden flow:

Calculate Need = Max − Allocation → initialize Work = Available → find Need ≤ Work → add released Allocation to Work → repeat → write the safe sequence.

Deadlock Prevention, Avoidance, Detection & Recovery Practice Questions

Q1. What is deadlock prevention?
Q2. How can Mutual Exclusion be prevented?
Q3. How can Hold and Wait be prevented?
Q4. How can No Preemption be broken?
Q5. How can Circular Wait be prevented?
Q6. What is deadlock avoidance?
Q7. What is a safe state?
Q8. What is an unsafe state?
Q9. Does unsafe state mean deadlock?
Q10. What is a safe sequence?
Q11. What is Banker's Algorithm?
Q12. What is the Need matrix?
Q13. Explain the safety algorithm.
Q14. Explain the resource-request algorithm.
Q15. What is deadlock detection?
Q16. How is a Wait-for Graph used for deadlock detection?
Q17. How is deadlock detected with multiple resource instances?
Q18. What is deadlock recovery?
Q19. Explain recovery by process termination.
Q20. Explain resource preemption and rollback.
Q21. What factors are used in victim selection?
Q22. Differentiate deadlock prevention and avoidance.
Q23. Differentiate avoidance and detection.
Q24. Why can starvation occur during recovery?

Deadlock Handling Quick Revision

Prevention: break one necessary deadlock condition.
Avoidance: stay in a safe state.
Detection: identify an existing deadlock.
Recovery: break the detected deadlock.
Safe State: at least one safe sequence exists.
Unsafe State: no guaranteed safe sequence is available.
Unsafe ≠ Deadlocked: unsafe means risk, not proof of existing deadlock.
Banker's Algorithm: famous deadlock-avoidance algorithm.
Need: Max − Allocation.
Work: temporary available vector used during safety checking.
Safe Sequence: order in which all processes can finish.
Wait-for Graph: useful for single-instance deadlock detection.
Multiple-Instance Detection: uses Available, Allocation and Request.
Termination: kill one or more deadlocked processes.
Preemption: take a suitable resource from a victim.
Rollback: restore victim process to an earlier safe state.
Victim Selection: choose the lowest-cost process or resource to sacrifice.
Recovery Risk: repeated victim selection can create starvation.

Frequently Asked Questions About Deadlock Handling in Operating System

What are the methods of handling deadlock in Operating System?

The major methods are deadlock prevention, deadlock avoidance, deadlock detection and deadlock recovery.

What is deadlock prevention?

Deadlock prevention is a method that makes at least one necessary condition for deadlock impossible through resource-allocation rules.

How can circular wait be prevented?

Circular wait can be prevented by giving resource types a fixed order and requiring processes to request resources only according to that order.

What is deadlock avoidance?

Deadlock avoidance examines resource requests before granting them and grants a request only if the resulting system state remains safe.

What is a safe state in Operating System?

A safe state is one in which at least one sequence exists that allows every process to obtain its remaining required resources, finish and release its allocated resources.

What is an unsafe state?

An unsafe state is one in which the operating system cannot guarantee a safe completion sequence based on the current allocation and declared maximum demands.

Is an unsafe state the same as deadlock?

No. An unsafe state means deadlock may become possible. A deadlocked state means processes are already unable to make progress because of resource dependencies.

What is Banker's Algorithm?

Banker's Algorithm is a deadlock-avoidance algorithm that checks whether granting a resource request keeps the system in a safe state.

What is the Need matrix in Banker's Algorithm?

The Need matrix represents the remaining maximum resource requirement of each process and is calculated as Need = Max − Allocation.

What is the safety algorithm?

The safety algorithm simulates whether processes can complete one by one using currently available resources plus resources released by previously completed processes. If all processes can finish, the state is safe.

What is the resource-request algorithm?

The resource-request algorithm checks whether a process's request is within its remaining Need and current Available resources. It then temporarily grants the request and runs the safety algorithm before making the allocation permanent.

What is deadlock detection?

Deadlock detection allows resource allocations to occur and later analyzes process and resource relationships to determine whether deadlock exists.

How is deadlock detected when each resource type has one instance?

A Wait-for Graph can be used. If the graph contains a cycle, the processes in that cycle are deadlocked.

How is deadlock detected with multiple resource instances?

A matrix-based detection algorithm can use Available, Allocation and current Request information to determine which processes can finish. Processes that remain unfinished are part of the detected deadlocked set.

What is deadlock recovery?

Deadlock recovery is the process of breaking an existing deadlock after it has been detected.

How can an operating system recover from deadlock?

The system can terminate deadlocked processes, terminate selected victims, preempt suitable resources, roll processes back or combine these techniques.

What is victim selection in deadlock recovery?

Victim selection means choosing the process or resource whose termination or preemption will break deadlock with acceptable cost.

What is rollback in deadlock recovery?

Rollback restores a process to an earlier consistent state so that resources can be reclaimed and the process can later restart from that point.

What is the difference between prevention and avoidance?

Prevention permanently restricts resource allocation so that a necessary deadlock condition cannot hold. Avoidance dynamically evaluates individual requests and grants them only when the state remains safe.

What is the difference between avoidance and detection?

Avoidance acts before granting a potentially unsafe request. Detection allows allocations and later checks whether deadlock has actually occurred.

Conclusion

Deadlock Prevention, Avoidance, Detection and Recovery in Operating System are four different answers to the same problem: how should the operating system handle processes that compete for limited resources?

Deadlock Prevention changes resource-allocation rules so that one necessary deadlock condition cannot occur. Deadlock Avoidance is more flexible and checks each risky request before granting it.

The key avoidance idea is the safe state. Banker's Algorithm uses Available, Allocation, Max and Need to determine whether a safe sequence exists.

Deadlock Detection takes the opposite approach: allow allocation and later inspect whether processes are actually deadlocked. Single-instance systems can use a Wait-for Graph, while multiple-instance systems require a more detailed detection algorithm.

Finally, Deadlock Recovery restores progress by terminating processes, preempting resources, rolling processes back or choosing a suitable victim.

The easiest way to remember the full chapter is: Prevention stops the possibility, Avoidance stays safe, Detection finds the problem, and Recovery breaks the problem.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Join Telegram Exam updates and free resources