SlideShare a Scribd company logo
1 of 19
Deadlock
Deadlock
Each thread is waiting on a
resource held by another
thread
 So, there is no way to make
progress
Thread 1
Thread 2 Thread 3
Deadlock, Illustrated
Necessary Conditions for Deadlock
Mutual exclusion
 Resources cannot be shared
 e.g., buffers, locks
Hold and wait (subset property)
 A thread must hold a subset of its resource needs
 And, the thread is waiting for more resources
No preemption
 Resources cannot be taken away
Circular wait
 A needs a resource that B has
 B has a resource that A has
Resource Allocation Graph with a Deadlock
P => R: request edge
R => P: assignment edge
Cycle Without Deadlock
P => R: request edge
R => P: assignment edge
Why is there no deadlock
here?
Graph Reduction
A graph can be reduced by a thread if all of that
thread’s requests can be granted
 Eventually, all resources by the reduced thread will be freed
Miscellaneous theorems (Holt, Havender):
 There are no deadlocked threads iff the graph is completely
reducible
 The order of reductions is irrelevant
(Detail: resources with multiple units)
Graph with Deadlock
cs431-cotter
8
P1 P2 P3
Approaches to Deadlock
1. Avoid threads
2. Deadlock prevention
 Break up one of the four necessary conditions
1. Deadlock avoidance
 Stay live even in the presence of the four conditions
1. Detect and recover
Approach #1: Avoid Threads
Brain dead solution: avoid deadlock by avoiding
threads
Example: GUI frameworks
 Typically use a single event-dispatch thread
Operating System
GUI Framework
Application
mouse
click
change
background
color
Approach #2: Prevention
Can we eliminate:
Mutual exclusion?
Hold and wait (subset property)?
No Preemption?
Circular waiting?
Lock Ordering
We can avoid circular waiting by acquiring resources
in a fixed order
Example: Linux rename operation
 Each open file has a semaphore
 Both semaphores must be held during file operations
 Linux always uses the same order for down operations
 Semaphore at the lowest memory address goes first
Rename Example
Process 1: rename (“foo.txt”,”bar.txt”);
Process 2: rename (“bar.txt”,”foo.txt”);
down()
foo semaphore
down()
bar semaphore
up()
bar semaphore
up()
foo semaphore
down()
foo semaphore
down()
bar semaphore
up()
bar semaphore
up()
foo semaphore
Approach #3: Avoidance
Intuition: the four
conditions do not always
lead to deadlock
 “necessary but not sufficient”
We can stay live if we know
the resource needs of the
processes
Bankers Algorithm Overview
Basic idea: ensure that we always have an “escape
route”
 The resource graph is reducible
This can be enforced with the bankers algorithm:
 When a request is made
 Pretend you granted it
 Pretend all other legal requests were made
 Can the graph be reduced?
 If so, allocate the requested resource
 If not, block the thread
Deadlock Avoidance in Practice
Static provisioning
 Ensure that each active process/thread can acquire some
minimum set of resources
 Use admission control to maintain this invariant
This is closely related to the idea of thrashing
 Each thread needs some minimum amount of resources to run
efficiently
Approach #4: Detection and Recovery
Not commonly used
 Detection is expensive
 Recovery is tricky
Possible exception: databases
Deadlock Detection
Detection algorithm (sketch)
 Keep track of who is waiting for resources
 Keep track of who holds resources
 Assume that all runnable processes release all their resources
 Does this unblock a waiting process?
 If yes, release that process’s resources
 If processes are still blocked, we are deadlocked
Os deadlock

More Related Content

What's hot

Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating systemMidhun Sankar
 
Mch7 deadlock
Mch7 deadlockMch7 deadlock
Mch7 deadlockwahab13
 
Methods for handling deadlocks
Methods for handling deadlocksMethods for handling deadlocks
Methods for handling deadlocksA. S. M. Shafi
 
Operating system Dead lock
Operating system Dead lockOperating system Dead lock
Operating system Dead lockKaram Munir Butt
 
Deadlock Detection in Distributed Systems
Deadlock Detection in Distributed SystemsDeadlock Detection in Distributed Systems
Deadlock Detection in Distributed SystemsDHIVYADEVAKI
 
Dead Lock In Operating Systems
Dead Lock In Operating SystemsDead Lock In Operating Systems
Dead Lock In Operating Systemstotallooser
 
The implementation of Banker's algorithm, data structure and its parser
The implementation of Banker's algorithm, data structure and its parserThe implementation of Banker's algorithm, data structure and its parser
The implementation of Banker's algorithm, data structure and its parserMatthew Chang
 
Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)
Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)
Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)Shayek Parvez
 

What's hot (20)

OSCh8
OSCh8OSCh8
OSCh8
 
Bankers
BankersBankers
Bankers
 
7 Deadlocks
7 Deadlocks7 Deadlocks
7 Deadlocks
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Deadlocks
Deadlocks Deadlocks
Deadlocks
 
Mch7 deadlock
Mch7 deadlockMch7 deadlock
Mch7 deadlock
 
Ice
IceIce
Ice
 
Methods for handling deadlocks
Methods for handling deadlocksMethods for handling deadlocks
Methods for handling deadlocks
 
Operating system Dead lock
Operating system Dead lockOperating system Dead lock
Operating system Dead lock
 
Deadlock Detection in Distributed Systems
Deadlock Detection in Distributed SystemsDeadlock Detection in Distributed Systems
Deadlock Detection in Distributed Systems
 
Dead Lock In Operating Systems
Dead Lock In Operating SystemsDead Lock In Operating Systems
Dead Lock In Operating Systems
 
Lect05
Lect05Lect05
Lect05
 
Deadlock
DeadlockDeadlock
Deadlock
 
OS_Ch8
OS_Ch8OS_Ch8
OS_Ch8
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlocks
 Deadlocks Deadlocks
Deadlocks
 
The implementation of Banker's algorithm, data structure and its parser
The implementation of Banker's algorithm, data structure and its parserThe implementation of Banker's algorithm, data structure and its parser
The implementation of Banker's algorithm, data structure and its parser
 
Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)
Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)
Deadlock avoidance (Safe State, Resource Allocation Graph Algorithm)
 

Similar to Os deadlock

Semaphores and Monitors
 Semaphores and Monitors Semaphores and Monitors
Semaphores and Monitorssathish sak
 
what every web and app developer should know about multithreading
what every web and app developer should know about multithreadingwhat every web and app developer should know about multithreading
what every web and app developer should know about multithreadingIlya Haykinson
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidancewahab13
 
Deadlocks 160928121516-160928183232
Deadlocks 160928121516-160928183232Deadlocks 160928121516-160928183232
Deadlocks 160928121516-160928183232marangburu42
 
Google: Cluster computing and MapReduce: Introduction to Distributed System D...
Google: Cluster computing and MapReduce: Introduction to Distributed System D...Google: Cluster computing and MapReduce: Introduction to Distributed System D...
Google: Cluster computing and MapReduce: Introduction to Distributed System D...tugrulh
 
Multithreading 101
Multithreading 101Multithreading 101
Multithreading 101Tim Penhey
 
RedisConf17 - Internet Archive - Preventing Cache Stampede with Redis and XFetch
RedisConf17 - Internet Archive - Preventing Cache Stampede with Redis and XFetchRedisConf17 - Internet Archive - Preventing Cache Stampede with Redis and XFetch
RedisConf17 - Internet Archive - Preventing Cache Stampede with Redis and XFetchRedis Labs
 
Deadlock Detection Algorithm
Deadlock Detection AlgorithmDeadlock Detection Algorithm
Deadlock Detection AlgorithmMohammad Qureshi
 
Deadlocks prefinal
Deadlocks prefinalDeadlocks prefinal
Deadlocks prefinalmarangburu42
 
Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456marangburu42
 
2023comp90024_linux2.pdf
2023comp90024_linux2.pdf2023comp90024_linux2.pdf
2023comp90024_linux2.pdfLevLafayette1
 
Section07-Deadlocks (1).ppt
Section07-Deadlocks (1).pptSection07-Deadlocks (1).ppt
Section07-Deadlocks (1).pptamadayshwan
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlockstech2click
 
Automating the Hunt for Non-Obvious Sources of Latency Spreads
Automating the Hunt for Non-Obvious Sources of Latency SpreadsAutomating the Hunt for Non-Obvious Sources of Latency Spreads
Automating the Hunt for Non-Obvious Sources of Latency SpreadsScyllaDB
 

Similar to Os deadlock (20)

Semaphores and Monitors
 Semaphores and Monitors Semaphores and Monitors
Semaphores and Monitors
 
what every web and app developer should know about multithreading
what every web and app developer should know about multithreadingwhat every web and app developer should know about multithreading
what every web and app developer should know about multithreading
 
CH07.pdf
CH07.pdfCH07.pdf
CH07.pdf
 
deadlock avoidance
deadlock avoidancedeadlock avoidance
deadlock avoidance
 
10. deadlock
10. deadlock10. deadlock
10. deadlock
 
Os module 2 d
Os module 2 dOs module 2 d
Os module 2 d
 
Deadlocks 160928121516-160928183232
Deadlocks 160928121516-160928183232Deadlocks 160928121516-160928183232
Deadlocks 160928121516-160928183232
 
Google: Cluster computing and MapReduce: Introduction to Distributed System D...
Google: Cluster computing and MapReduce: Introduction to Distributed System D...Google: Cluster computing and MapReduce: Introduction to Distributed System D...
Google: Cluster computing and MapReduce: Introduction to Distributed System D...
 
Multithreading 101
Multithreading 101Multithreading 101
Multithreading 101
 
Module3
Module3Module3
Module3
 
RedisConf17 - Internet Archive - Preventing Cache Stampede with Redis and XFetch
RedisConf17 - Internet Archive - Preventing Cache Stampede with Redis and XFetchRedisConf17 - Internet Archive - Preventing Cache Stampede with Redis and XFetch
RedisConf17 - Internet Archive - Preventing Cache Stampede with Redis and XFetch
 
Deadlock Detection Algorithm
Deadlock Detection AlgorithmDeadlock Detection Algorithm
Deadlock Detection Algorithm
 
Deadlocks prefinal
Deadlocks prefinalDeadlocks prefinal
Deadlocks prefinal
 
Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456Deadlocksprefinal 161014115456
Deadlocksprefinal 161014115456
 
MultiThreading in Python
MultiThreading in PythonMultiThreading in Python
MultiThreading in Python
 
2023comp90024_linux2.pdf
2023comp90024_linux2.pdf2023comp90024_linux2.pdf
2023comp90024_linux2.pdf
 
Section07-Deadlocks (1).ppt
Section07-Deadlocks (1).pptSection07-Deadlocks (1).ppt
Section07-Deadlocks (1).ppt
 
Process Synchronization And Deadlocks
Process Synchronization And DeadlocksProcess Synchronization And Deadlocks
Process Synchronization And Deadlocks
 
Automating the Hunt for Non-Obvious Sources of Latency Spreads
Automating the Hunt for Non-Obvious Sources of Latency SpreadsAutomating the Hunt for Non-Obvious Sources of Latency Spreads
Automating the Hunt for Non-Obvious Sources of Latency Spreads
 
Ch 4 deadlock
Ch 4 deadlockCh 4 deadlock
Ch 4 deadlock
 

Recently uploaded

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 

Recently uploaded (20)

mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 

Os deadlock

  • 2. Deadlock Each thread is waiting on a resource held by another thread  So, there is no way to make progress Thread 1 Thread 2 Thread 3
  • 4. Necessary Conditions for Deadlock Mutual exclusion  Resources cannot be shared  e.g., buffers, locks Hold and wait (subset property)  A thread must hold a subset of its resource needs  And, the thread is waiting for more resources No preemption  Resources cannot be taken away Circular wait  A needs a resource that B has  B has a resource that A has
  • 5. Resource Allocation Graph with a Deadlock P => R: request edge R => P: assignment edge
  • 6. Cycle Without Deadlock P => R: request edge R => P: assignment edge Why is there no deadlock here?
  • 7. Graph Reduction A graph can be reduced by a thread if all of that thread’s requests can be granted  Eventually, all resources by the reduced thread will be freed Miscellaneous theorems (Holt, Havender):  There are no deadlocked threads iff the graph is completely reducible  The order of reductions is irrelevant (Detail: resources with multiple units)
  • 9. Approaches to Deadlock 1. Avoid threads 2. Deadlock prevention  Break up one of the four necessary conditions 1. Deadlock avoidance  Stay live even in the presence of the four conditions 1. Detect and recover
  • 10. Approach #1: Avoid Threads Brain dead solution: avoid deadlock by avoiding threads Example: GUI frameworks  Typically use a single event-dispatch thread Operating System GUI Framework Application mouse click change background color
  • 11. Approach #2: Prevention Can we eliminate: Mutual exclusion? Hold and wait (subset property)? No Preemption? Circular waiting?
  • 12. Lock Ordering We can avoid circular waiting by acquiring resources in a fixed order Example: Linux rename operation  Each open file has a semaphore  Both semaphores must be held during file operations  Linux always uses the same order for down operations  Semaphore at the lowest memory address goes first
  • 13. Rename Example Process 1: rename (“foo.txt”,”bar.txt”); Process 2: rename (“bar.txt”,”foo.txt”); down() foo semaphore down() bar semaphore up() bar semaphore up() foo semaphore down() foo semaphore down() bar semaphore up() bar semaphore up() foo semaphore
  • 14. Approach #3: Avoidance Intuition: the four conditions do not always lead to deadlock  “necessary but not sufficient” We can stay live if we know the resource needs of the processes
  • 15. Bankers Algorithm Overview Basic idea: ensure that we always have an “escape route”  The resource graph is reducible This can be enforced with the bankers algorithm:  When a request is made  Pretend you granted it  Pretend all other legal requests were made  Can the graph be reduced?  If so, allocate the requested resource  If not, block the thread
  • 16. Deadlock Avoidance in Practice Static provisioning  Ensure that each active process/thread can acquire some minimum set of resources  Use admission control to maintain this invariant This is closely related to the idea of thrashing  Each thread needs some minimum amount of resources to run efficiently
  • 17. Approach #4: Detection and Recovery Not commonly used  Detection is expensive  Recovery is tricky Possible exception: databases
  • 18. Deadlock Detection Detection algorithm (sketch)  Keep track of who is waiting for resources  Keep track of who holds resources  Assume that all runnable processes release all their resources  Does this unblock a waiting process?  If yes, release that process’s resources  If processes are still blocked, we are deadlocked

Editor's Notes

  1. TODO: print handouts for AspectRatio
  2. Buffer pool: Buffers cannot be shared Each thread can allocate some (but not all) of its resource No way for resources to be taken away Thread A needs the buffers of thread B (and vice versa)
  3. Nope: this graph is reducible