SlideShare ist ein Scribd-Unternehmen logo
1 von 17
NAME:- SHIVANGI
DEPT:- COMPUTER SCIENCE & ENGINEERING
ROLL NO:- ‘9’
University roll:-’10500112023’
GROUP:- ”X”
TOPIC NAME:- “Deadlocks”
SUBMITTED TO:- tapas sangiri
The Deadlock Problem
System Model
Deadlock Characterization
Methods for Handling Deadlocks
Deadlock Prevention
Deadlock Avoidance
Recovery from Deadlock
CONTENTS
The Deadlock Problem
EXAMPLES:
ï‚š "It takes money to make money".
 You can't get a job without experience; you can't get
experience without a job.
BACKGROUND:
The cause of deadlocks: Each process needing what another
process has. This results from sharing resources such as
memory devices, links.
Under normal operation, a resource allocations proceed like
this:
 Request a resource (suspend until available if necessary.
 Use the resource.
Deadlock Characterization
Deadlock can arise if four conditions hold simultaneously.
ï‚š Mutual exclusion: only one process at a time can use a
resource
ï‚š Hold and wait: a process holding at least one resource is
waiting to acquire additional resources held by other
processes
ï‚š No preemption: a resource can be released only
voluntarily by the process holding it, after that process has
completed its task
ï‚š Circular wait: there exists a set {P0, P1, 
, Pn} of waiting
processes such that P0 is waiting for a resource that is held
by P1, P1 is waiting for a resource that is held by P2, 
, Pn–1
is waiting for a resource that is held by Pn, and Pn is waiting
A visual ( mathematical ) way to determine if a deadlock has, or may occur.
G = ( V, E ) The graph contains nodes and edges
V Nodes consist of processes = { P1, P2, P3, ...} and
resource types
{ R1, R2, ...}
E Edges are ( Pi, Rj ) or ( Ri, Pj )
An arrow from the process to resource indicates the process is
requesting the resource. An arrow from resource to process shows an
instance of the resource has been allocated to the process.
Process is a circle, resource type is square; dots represent number of
instances of resource in type. Request points to square, assignment
comes from dot.
RESOURCE ALLOCATION
GRAPH
Pi
Rj
Pi
Rj
Pi
Example of a
Resource
Allocation Graph
Resource
Allocation
Graph With A
Deadlock
Graph With A
Cycle But No
Deadlock
RESOURCE ALLOCATION GRAP
Methods for Handling
Deadlocks
ï‚š Ensure that the system will never enter a
deadlock state – deadlock prevention
ï‚š Allow the system to enter a deadlock state
and then recover
ï‚š Ignore the problem and pretend that
deadlocks never occur in the system; used
by most operating systems, including UNIX
Do not allow one of the four conditions to occur.
Mutual exclusion:
a) Automatically holds for printers and other non-
sharables.
b) Shared entities (read only files) don't need mutual
exclusion (and aren’t susceptible to deadlock.)
c) Prevention not possible, since some devices are
intrinsically non-sharable.
Hold and wait:
a) Collect all resources before execution.
b) A particular resource can only be requested when no
others are being held. A sequence of resources is
always collected beginning with the same one.
c) Utilization is low, starvation possible.
Deadlock
Prevention
Deadlock Prevention (Cont.)
ï‚š No Preemption –
ï‚€ If a process that is holding some resources
requests another resource that cannot be
immediately allocated to it, then all resources
currently being held are released
ï‚€ Preempted resources are added to the list of
resources for which the process is waiting
ï‚€ Process will be restarted only when it can regain
its old resources, as well as the new ones that it is
requesting
ï‚š Circular Wait – impose a total ordering of all
resource types, and require that each process
requests resources in an increasing order of
enumeration
NOTE: All deadlocks are unsafe, but all unsafes
are NOT deadlocks.
SAFE
DEADLOCK
UNSAFE
Only with luck will
processes avoid
deadlock.
O.S. can avoid
deadlock.
Deadlock
Avoidance
ï‚š Single instance of a resource type
ï‚€Use a resource-allocation graph
ï‚š Multiple instances of a resource
type
ï‚€ Use the banker’s algorithm
Avoidance
algorithms
Safety Algorithm
1. Let Work and Finish be vectors of length m and n,
respectively. Initialize:
Work = Available
Finish [i] = false for i = 0, 1, 
, n- 1
2. Find an i such that both:
(a) Finish [i] = false
(b) Needi ï‚Ł Work
If no such i exists, go to step 4
3. Work = Work + Allocationi
Finish[i] = true
go to step 2
Example of Banker’s Algorithm
ï‚š 5 processes P0 through P4;
3 resource types:
A (10 instances), B (5instances), and C (7
instances)
Snapshot at time T0:
Allocation Max Available
A B C A B C A B C
P0 0 1 0 7 5 3 3 3 2
P1 2 0 0 3 2 2
P2 3 0 2 9 0 2
P3 2 1 1 2 2 2
Example (Cont.)
ï‚š The content of the matrix Need is defined to be Max
– Allocation
Need
A B C
P0 7 4 3
P1 1 2 2
P2 6 0 0
P3 0 1 1
P4 4 3 1
ï‚š The system is in a safe state since the sequence <
P1, P3, P4, P2, P0> satisfies safety criteria
Recovery from Deadlock:
Process Termination
ï‚š Abort all deadlocked processes
ï‚š Abort one process at a time until the deadlock cycle is
eliminated
ï‚š In which order should we choose to abort?
ï‚€ Priority of the process
ï‚€ How long process has computed, and how much
longer to completion
ï‚€ Resources the process has used
ï‚€ Resources process needs to complete
ï‚€ How many processes will need to be terminated
ï‚€ Is process interactive or batch?
Recovery from Deadlock:
Resource Preemption
ï‚š Selecting a victim – minimize cost
ï‚š Rollback – return to some safe state,
restart process for that state
ï‚š Problem: starvation – same process may
always be picked as victim, include number
of rollback in cost factor
Deadlock

Weitere Àhnliche Inhalte

Was ist angesagt?

OS - Deadlock
OS - DeadlockOS - Deadlock
OS - Deadlock
vinay arora
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
Piyush Rochwani
 

Was ist angesagt? (20)

Dead Lock in operating system
Dead Lock in operating systemDead Lock in operating system
Dead Lock in operating system
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
 
Operating system - Deadlock
Operating system - DeadlockOperating system - Deadlock
Operating system - Deadlock
 
deadlock handling
deadlock handlingdeadlock handling
deadlock handling
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Deadlock detection & prevention
Deadlock detection & preventionDeadlock detection & prevention
Deadlock detection & prevention
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
Chapter 7 - Deadlocks
Chapter 7 - DeadlocksChapter 7 - Deadlocks
Chapter 7 - Deadlocks
 
OS - Deadlock
OS - DeadlockOS - Deadlock
OS - Deadlock
 
Bankers algorithm
Bankers algorithmBankers algorithm
Bankers algorithm
 
Deadlocks
 Deadlocks Deadlocks
Deadlocks
 
Methods for handling deadlocks
Methods for handling deadlocksMethods for handling deadlocks
Methods for handling deadlocks
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Dead Lock In Operating Systems
Dead Lock In Operating SystemsDead Lock In Operating Systems
Dead Lock In Operating Systems
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on Segmentation
 
Chapter 9 - Virtual Memory
Chapter 9 - Virtual MemoryChapter 9 - Virtual Memory
Chapter 9 - Virtual Memory
 
Automata theory - CFG and normal forms
Automata theory - CFG and normal formsAutomata theory - CFG and normal forms
Automata theory - CFG and normal forms
 

Ähnlich wie Deadlock

Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
tech2click
 
FP 202 Chapter 2 - Part 3
FP 202 Chapter 2 - Part 3FP 202 Chapter 2 - Part 3
FP 202 Chapter 2 - Part 3
rohassanie
 
Module-2Deadlock.ppt
Module-2Deadlock.pptModule-2Deadlock.ppt
Module-2Deadlock.ppt
KAnurag2
 

Ähnlich wie Deadlock (20)

Gp1242 007 oer ppt
Gp1242 007 oer pptGp1242 007 oer ppt
Gp1242 007 oer ppt
 
Os module 2 d
Os module 2 dOs module 2 d
Os module 2 d
 
Section07-Deadlocks (1).ppt
Section07-Deadlocks (1).pptSection07-Deadlocks (1).ppt
Section07-Deadlocks (1).ppt
 
Section07-Deadlocks_operating_system.ppt
Section07-Deadlocks_operating_system.pptSection07-Deadlocks_operating_system.ppt
Section07-Deadlocks_operating_system.ppt
 
Mca ii os u-3 dead lock & io systems
Mca  ii  os u-3 dead lock & io systemsMca  ii  os u-3 dead lock & io systems
Mca ii os u-3 dead lock & io systems
 
CH07.pdf
CH07.pdfCH07.pdf
CH07.pdf
 
Dead Lock
Dead LockDead Lock
Dead Lock
 
Chapter 5(five).pdf
Chapter 5(five).pdfChapter 5(five).pdf
Chapter 5(five).pdf
 
Section07-Deadlocks.pdf
Section07-Deadlocks.pdfSection07-Deadlocks.pdf
Section07-Deadlocks.pdf
 
7308346-Deadlock.pptx
7308346-Deadlock.pptx7308346-Deadlock.pptx
7308346-Deadlock.pptx
 
OSLec14&15(Deadlocksinopratingsystem).pptx
OSLec14&15(Deadlocksinopratingsystem).pptxOSLec14&15(Deadlocksinopratingsystem).pptx
OSLec14&15(Deadlocksinopratingsystem).pptx
 
Deadlock
DeadlockDeadlock
Deadlock
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
 
Deadlocks prefinal
Deadlocks prefinalDeadlocks prefinal
Deadlocks prefinal
 
Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456
 
FP 202 Chapter 2 - Part 3
FP 202 Chapter 2 - Part 3FP 202 Chapter 2 - Part 3
FP 202 Chapter 2 - Part 3
 
Deadlock.ppt
Deadlock.pptDeadlock.ppt
Deadlock.ppt
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
Module-2Deadlock.ppt
Module-2Deadlock.pptModule-2Deadlock.ppt
Module-2Deadlock.ppt
 
Deadlocks
Deadlocks Deadlocks
Deadlocks
 

KĂŒrzlich hochgeladen

scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

KĂŒrzlich hochgeladen (20)

Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 

Deadlock

  • 1. NAME:- SHIVANGI DEPT:- COMPUTER SCIENCE & ENGINEERING ROLL NO:- ‘9’ University roll:-’10500112023’ GROUP:- ”X” TOPIC NAME:- “Deadlocks” SUBMITTED TO:- tapas sangiri
  • 2. The Deadlock Problem System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Recovery from Deadlock CONTENTS
  • 3. The Deadlock Problem EXAMPLES: ï‚š "It takes money to make money".  You can't get a job without experience; you can't get experience without a job. BACKGROUND: The cause of deadlocks: Each process needing what another process has. This results from sharing resources such as memory devices, links. Under normal operation, a resource allocations proceed like this:  Request a resource (suspend until available if necessary.  Use the resource.
  • 4. Deadlock Characterization Deadlock can arise if four conditions hold simultaneously. ï‚š Mutual exclusion: only one process at a time can use a resource ï‚š Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes ï‚š No preemption: a resource can be released only voluntarily by the process holding it, after that process has completed its task ï‚š Circular wait: there exists a set {P0, P1, 
, Pn} of waiting processes such that P0 is waiting for a resource that is held by P1, P1 is waiting for a resource that is held by P2, 
, Pn–1 is waiting for a resource that is held by Pn, and Pn is waiting
  • 5. A visual ( mathematical ) way to determine if a deadlock has, or may occur. G = ( V, E ) The graph contains nodes and edges V Nodes consist of processes = { P1, P2, P3, ...} and resource types { R1, R2, ...} E Edges are ( Pi, Rj ) or ( Ri, Pj ) An arrow from the process to resource indicates the process is requesting the resource. An arrow from resource to process shows an instance of the resource has been allocated to the process. Process is a circle, resource type is square; dots represent number of instances of resource in type. Request points to square, assignment comes from dot. RESOURCE ALLOCATION GRAPH Pi Rj Pi Rj Pi
  • 6. Example of a Resource Allocation Graph Resource Allocation Graph With A Deadlock Graph With A Cycle But No Deadlock RESOURCE ALLOCATION GRAP
  • 7. Methods for Handling Deadlocks ï‚š Ensure that the system will never enter a deadlock state – deadlock prevention ï‚š Allow the system to enter a deadlock state and then recover ï‚š Ignore the problem and pretend that deadlocks never occur in the system; used by most operating systems, including UNIX
  • 8. Do not allow one of the four conditions to occur. Mutual exclusion: a) Automatically holds for printers and other non- sharables. b) Shared entities (read only files) don't need mutual exclusion (and aren’t susceptible to deadlock.) c) Prevention not possible, since some devices are intrinsically non-sharable. Hold and wait: a) Collect all resources before execution. b) A particular resource can only be requested when no others are being held. A sequence of resources is always collected beginning with the same one. c) Utilization is low, starvation possible. Deadlock Prevention
  • 9. Deadlock Prevention (Cont.) ï‚š No Preemption – ï‚€ If a process that is holding some resources requests another resource that cannot be immediately allocated to it, then all resources currently being held are released ï‚€ Preempted resources are added to the list of resources for which the process is waiting ï‚€ Process will be restarted only when it can regain its old resources, as well as the new ones that it is requesting ï‚š Circular Wait – impose a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration
  • 10. NOTE: All deadlocks are unsafe, but all unsafes are NOT deadlocks. SAFE DEADLOCK UNSAFE Only with luck will processes avoid deadlock. O.S. can avoid deadlock. Deadlock Avoidance
  • 11. ï‚š Single instance of a resource type ï‚€Use a resource-allocation graph ï‚š Multiple instances of a resource type ï‚€ Use the banker’s algorithm Avoidance algorithms
  • 12. Safety Algorithm 1. Let Work and Finish be vectors of length m and n, respectively. Initialize: Work = Available Finish [i] = false for i = 0, 1, 
, n- 1 2. Find an i such that both: (a) Finish [i] = false (b) Needi ï‚Ł Work If no such i exists, go to step 4 3. Work = Work + Allocationi Finish[i] = true go to step 2
  • 13. Example of Banker’s Algorithm ï‚š 5 processes P0 through P4; 3 resource types: A (10 instances), B (5instances), and C (7 instances) Snapshot at time T0: Allocation Max Available A B C A B C A B C P0 0 1 0 7 5 3 3 3 2 P1 2 0 0 3 2 2 P2 3 0 2 9 0 2 P3 2 1 1 2 2 2
  • 14. Example (Cont.) ï‚š The content of the matrix Need is defined to be Max – Allocation Need A B C P0 7 4 3 P1 1 2 2 P2 6 0 0 P3 0 1 1 P4 4 3 1 ï‚š The system is in a safe state since the sequence < P1, P3, P4, P2, P0> satisfies safety criteria
  • 15. Recovery from Deadlock: Process Termination ï‚š Abort all deadlocked processes ï‚š Abort one process at a time until the deadlock cycle is eliminated ï‚š In which order should we choose to abort? ï‚€ Priority of the process ï‚€ How long process has computed, and how much longer to completion ï‚€ Resources the process has used ï‚€ Resources process needs to complete ï‚€ How many processes will need to be terminated ï‚€ Is process interactive or batch?
  • 16. Recovery from Deadlock: Resource Preemption ï‚š Selecting a victim – minimize cost ï‚š Rollback – return to some safe state, restart process for that state ï‚š Problem: starvation – same process may always be picked as victim, include number of rollback in cost factor