SlideShare a Scribd company logo
1 of 14
Presented by :
Saad Wazir
BS-CS
REG# 1421-212019


                                                PRESTON
                   Thursday , August 09, 2012   University
Deadlock Definition :
   There exists a cycle of processes such that each
    process cannot proceed until the next process
    takes some specific action.

   Result: all processes in the cycle are stuck!


                                P1        R2



                                R1        P2
Deadlock solutions:
- Prevention :
• Design system so that deadlock is impossible
- Avoidance :
• Steer around deadlock with smart scheduling
- Detection & recovery :
• Check for deadlock periodically
• Recover by killing a deadlocked processes and releasing its resources
- Do nothing :
• Prevention, avoidance and detection/recovery are expensive
• Manual intervention (kill processes, reboot) if needed
Deadlock Prevention:

#1: No mutual exclusion
• only one process at a time can use a resource.
#2: no preemption
• previously granted resources cannot forcibly taken away.
#3: No hold and wait
• When waiting for a resource, must not currently hold any resource
#4: circular wait condition
• Must be A circular chain of 2 or more processes
• When Waiting For Resource Must Not Currently Hold Any Resource
Over View OF Deadlock Detection & Recovery :
Deadlock Detection :

Check to see if a deadlock has occurred!

- Special case: Single resource per type
• E.g., mutex locks (value is zero or one)
• Check for cycles in the resource allocation graph
- General case
• E.g., semaphores, memory pages, ...
Dependencies B/W processes:




                               Corresponding
Resource allocation graph
                            process dependency
                                   graph
Deadlock Recovery:
Recovery idea: get rid of the cycles in
the process dependency graph

Options:
• Kill all deadlocked processes.
• Kill one deadlocked process at a time and
release its resources.
• Steal one resource at a time.
• Roll back all or one of the processes to
Safe state.
Deadlock Recovery:


      Only have to                       Have to kill
        kill one                         one more




                 Corresponding Process
                   dependency graph
Deadlock Recovery:

 How should we pick a process to kill?
 We might consider...

 • process priority
 • current computation time and time to completion
 • amount of resources used by the process
 • amount of resources needed by the process to complete
 • is process interactive or batch?
Rollback instead of killing processes:
 Selecting a victim
 • Minimize cost of rollback (e.g., size of process’s memory).

 Rollback
 • Return to some safe state
 • Restart process for that state


 Note: Large, long computations are
 sometimes checkpointed for other reasons (reliability) anyway
Deadlock Summary:
 Deadlock: cycle of processes/threads each waiting for the next
 • Nasty timing-dependent bugs!

 Detection & Recovery
 • Typically very expensive to kill / checkpoint processes

 Avoidance: steer around deadlock
 • Requires knowledge of everything an application will request
 • Expensive to perform on each scheduling event
Hope you enjoy & learn something 



                         Special Thanks to :
Philip Godfrey
CS 241
University of Illinois                Fahad Wazir (Little Brother) , kamran Shah & Mian Abdul


                                                                               PRESTON
                                               Thursday , August 09, 2012      University

More Related Content

What's hot

Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating SystemsRitu Ranjan Shrivastwa
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating systemSara Ali
 
File access methods.54
File access methods.54File access methods.54
File access methods.54myrajendra
 
File Management in Operating System
File Management in Operating SystemFile Management in Operating System
File Management in Operating SystemJanki Shah
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInteX Research Lab
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSvampugani
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMSkoolkampus
 
Process management os concept
Process management os conceptProcess management os concept
Process management os conceptpriyadeosarkar91
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.Ravi Kumar Patel
 
Memory organisation ppt final presentation
Memory organisation ppt final presentationMemory organisation ppt final presentation
Memory organisation ppt final presentationrockymani
 
Operating system 31 multiple processor scheduling
Operating system 31 multiple processor schedulingOperating system 31 multiple processor scheduling
Operating system 31 multiple processor schedulingVaibhav Khanna
 
Concurrent transactions
Concurrent transactionsConcurrent transactions
Concurrent transactionsSajan Sahu
 

What's hot (20)

Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
 
File Management in Operating System
File Management in Operating SystemFile Management in Operating System
File Management in Operating System
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer Architecture
 
File allocation methods (1)
File allocation methods (1)File allocation methods (1)
File allocation methods (1)
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
process control block
process control blockprocess control block
process control block
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Deadlock Avoidance in Operating System
Deadlock Avoidance in Operating SystemDeadlock Avoidance in Operating System
Deadlock Avoidance in Operating System
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
Cache memory
Cache memoryCache memory
Cache memory
 
Memory organisation ppt final presentation
Memory organisation ppt final presentationMemory organisation ppt final presentation
Memory organisation ppt final presentation
 
Operating system 31 multiple processor scheduling
Operating system 31 multiple processor schedulingOperating system 31 multiple processor scheduling
Operating system 31 multiple processor scheduling
 
System calls
System callsSystem calls
System calls
 
Concurrent transactions
Concurrent transactionsConcurrent transactions
Concurrent transactions
 
Operating system critical section
Operating system   critical sectionOperating system   critical section
Operating system critical section
 

Viewers also liked

Deadlock Detection
Deadlock DetectionDeadlock Detection
Deadlock DetectionPOOJA MEHTA
 
Deadlock Detection
Deadlock DetectionDeadlock Detection
Deadlock DetectionStuart Joy
 
Deadlock detection in distributed systems
Deadlock detection in distributed systemsDeadlock detection in distributed systems
Deadlock detection in distributed systemsReza Ramezani
 
Deadlock detection
Deadlock detectionDeadlock detection
Deadlock detectionNadia Nahar
 
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURYdeadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURYअनिकेत चौधरी
 
Deadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikDeadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikSaeed Siddik
 
Chapter 03
Chapter 03Chapter 03
Chapter 03 Google
 
Google Fusion Tables - Silicon Valley CodeCamp 2010
Google Fusion Tables - Silicon Valley CodeCamp 2010Google Fusion Tables - Silicon Valley CodeCamp 2010
Google Fusion Tables - Silicon Valley CodeCamp 2010Kathryn Brisbin
 
protocols of concurrency control
protocols of concurrency controlprotocols of concurrency control
protocols of concurrency controlMOHIT DADU
 
Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)
Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)
Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)Beat Signer
 
OS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switchOS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switchDaniel Ben-Zvi
 
Lecture 19.1a- Acid/Base Properties
Lecture 19.1a- Acid/Base PropertiesLecture 19.1a- Acid/Base Properties
Lecture 19.1a- Acid/Base PropertiesMary Beth Smith
 
Transaction states and properties
Transaction states and propertiesTransaction states and properties
Transaction states and propertiesChetan Mahawar
 
Concurrency (Distributed computing)
Concurrency (Distributed computing)Concurrency (Distributed computing)
Concurrency (Distributed computing)Sri Prasanna
 

Viewers also liked (20)

Deadlock Detection
Deadlock DetectionDeadlock Detection
Deadlock Detection
 
Deadlock Detection
Deadlock DetectionDeadlock Detection
Deadlock Detection
 
Deadlock detection in distributed systems
Deadlock detection in distributed systemsDeadlock detection in distributed systems
Deadlock detection in distributed systems
 
Deadlock detection
Deadlock detectionDeadlock detection
Deadlock detection
 
Distributed deadlock
Distributed deadlockDistributed deadlock
Distributed deadlock
 
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURYdeadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
deadlock detection using Goldman's algorithm by ANIKET CHOUDHURY
 
Deadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddikDeadlock in distribute system by saeed siddik
Deadlock in distribute system by saeed siddik
 
Chapter 7 - Deadlocks
Chapter 7 - DeadlocksChapter 7 - Deadlocks
Chapter 7 - Deadlocks
 
Chapter 03
Chapter 03Chapter 03
Chapter 03
 
Google Fusion Tables - Silicon Valley CodeCamp 2010
Google Fusion Tables - Silicon Valley CodeCamp 2010Google Fusion Tables - Silicon Valley CodeCamp 2010
Google Fusion Tables - Silicon Valley CodeCamp 2010
 
protocols of concurrency control
protocols of concurrency controlprotocols of concurrency control
protocols of concurrency control
 
Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)
Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)
Storage Management - Lecture 8 - Introduction to Databases (1007156ANR)
 
INTERNRESUME
INTERNRESUMEINTERNRESUME
INTERNRESUME
 
OS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switchOS scheduling and The anatomy of a context switch
OS scheduling and The anatomy of a context switch
 
GIS Mapping Webinar Part 3
GIS Mapping Webinar Part 3  GIS Mapping Webinar Part 3
GIS Mapping Webinar Part 3
 
Lecture 19.1a- Acid/Base Properties
Lecture 19.1a- Acid/Base PropertiesLecture 19.1a- Acid/Base Properties
Lecture 19.1a- Acid/Base Properties
 
Deadlock
DeadlockDeadlock
Deadlock
 
Transaction states and properties
Transaction states and propertiesTransaction states and properties
Transaction states and properties
 
Concurrency (Distributed computing)
Concurrency (Distributed computing)Concurrency (Distributed computing)
Concurrency (Distributed computing)
 
OSCh10
OSCh10OSCh10
OSCh10
 

Similar to Deadlock detection and recovery by saad symbian

Dmitriy Desyatkov "Secure SDLC or Security Culture to be or not to be"
Dmitriy Desyatkov "Secure SDLC or Security Culture to be or not to be"Dmitriy Desyatkov "Secure SDLC or Security Culture to be or not to be"
Dmitriy Desyatkov "Secure SDLC or Security Culture to be or not to be"WrikeTechClub
 
deadlock and starvation resources allocation.pptx
deadlock and starvation resources allocation.pptxdeadlock and starvation resources allocation.pptx
deadlock and starvation resources allocation.pptxSaba651353
 
3.6 Deadlock-operating system unit 3.pptx
3.6 Deadlock-operating system unit 3.pptx3.6 Deadlock-operating system unit 3.pptx
3.6 Deadlock-operating system unit 3.pptxsvulasal
 
24 to 25 deadlockprevention
24 to 25 deadlockprevention24 to 25 deadlockprevention
24 to 25 deadlockpreventionmyrajendra
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating SystemAUST
 
3 (1) [Autosaved].ppt
3 (1) [Autosaved].ppt3 (1) [Autosaved].ppt
3 (1) [Autosaved].pptamadayshwan
 
The Functions of the Operating System
The Functions of the Operating SystemThe Functions of the Operating System
The Functions of the Operating Systemandyr91
 

Similar to Deadlock detection and recovery by saad symbian (20)

Deadlock in Operating Systems
Deadlock in Operating SystemsDeadlock in Operating Systems
Deadlock in Operating Systems
 
Dmitriy Desyatkov "Secure SDLC or Security Culture to be or not to be"
Dmitriy Desyatkov "Secure SDLC or Security Culture to be or not to be"Dmitriy Desyatkov "Secure SDLC or Security Culture to be or not to be"
Dmitriy Desyatkov "Secure SDLC or Security Culture to be or not to be"
 
06-Deadlocks.ppt
06-Deadlocks.ppt06-Deadlocks.ppt
06-Deadlocks.ppt
 
chapter06-new.pptx
chapter06-new.pptxchapter06-new.pptx
chapter06-new.pptx
 
deadlock and starvation resources allocation.pptx
deadlock and starvation resources allocation.pptxdeadlock and starvation resources allocation.pptx
deadlock and starvation resources allocation.pptx
 
Chapter06.ppt
Chapter06.pptChapter06.ppt
Chapter06.ppt
 
Ch 4 deadlock
Ch 4 deadlockCh 4 deadlock
Ch 4 deadlock
 
Chapter06
Chapter06Chapter06
Chapter06
 
Deadlocks1
Deadlocks1Deadlocks1
Deadlocks1
 
3.6 Deadlock-operating system unit 3.pptx
3.6 Deadlock-operating system unit 3.pptx3.6 Deadlock-operating system unit 3.pptx
3.6 Deadlock-operating system unit 3.pptx
 
24 to 25 deadlockprevention
24 to 25 deadlockprevention24 to 25 deadlockprevention
24 to 25 deadlockprevention
 
Deadlock Slides
Deadlock SlidesDeadlock Slides
Deadlock Slides
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
3 (2).ppt
3 (2).ppt3 (2).ppt
3 (2).ppt
 
Deadlock in Operating System
Deadlock in Operating SystemDeadlock in Operating System
Deadlock in Operating System
 
Deadlocks2
Deadlocks2Deadlocks2
Deadlocks2
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
3 (1) [Autosaved].ppt
3 (1) [Autosaved].ppt3 (1) [Autosaved].ppt
3 (1) [Autosaved].ppt
 
Deadlocks
DeadlocksDeadlocks
Deadlocks
 
The Functions of the Operating System
The Functions of the Operating SystemThe Functions of the Operating System
The Functions of the Operating System
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

Deadlock detection and recovery by saad symbian

  • 1. Presented by : Saad Wazir BS-CS REG# 1421-212019 PRESTON Thursday , August 09, 2012 University
  • 2. Deadlock Definition :  There exists a cycle of processes such that each process cannot proceed until the next process takes some specific action.  Result: all processes in the cycle are stuck! P1 R2 R1 P2
  • 3. Deadlock solutions: - Prevention : • Design system so that deadlock is impossible - Avoidance : • Steer around deadlock with smart scheduling - Detection & recovery : • Check for deadlock periodically • Recover by killing a deadlocked processes and releasing its resources - Do nothing : • Prevention, avoidance and detection/recovery are expensive • Manual intervention (kill processes, reboot) if needed
  • 4. Deadlock Prevention: #1: No mutual exclusion • only one process at a time can use a resource. #2: no preemption • previously granted resources cannot forcibly taken away. #3: No hold and wait • When waiting for a resource, must not currently hold any resource #4: circular wait condition • Must be A circular chain of 2 or more processes • When Waiting For Resource Must Not Currently Hold Any Resource
  • 5.
  • 6. Over View OF Deadlock Detection & Recovery :
  • 7. Deadlock Detection : Check to see if a deadlock has occurred! - Special case: Single resource per type • E.g., mutex locks (value is zero or one) • Check for cycles in the resource allocation graph - General case • E.g., semaphores, memory pages, ...
  • 8. Dependencies B/W processes: Corresponding Resource allocation graph process dependency graph
  • 9. Deadlock Recovery: Recovery idea: get rid of the cycles in the process dependency graph Options: • Kill all deadlocked processes. • Kill one deadlocked process at a time and release its resources. • Steal one resource at a time. • Roll back all or one of the processes to Safe state.
  • 10. Deadlock Recovery: Only have to Have to kill kill one one more Corresponding Process dependency graph
  • 11. Deadlock Recovery: How should we pick a process to kill? We might consider... • process priority • current computation time and time to completion • amount of resources used by the process • amount of resources needed by the process to complete • is process interactive or batch?
  • 12. Rollback instead of killing processes: Selecting a victim • Minimize cost of rollback (e.g., size of process’s memory). Rollback • Return to some safe state • Restart process for that state Note: Large, long computations are sometimes checkpointed for other reasons (reliability) anyway
  • 13. Deadlock Summary: Deadlock: cycle of processes/threads each waiting for the next • Nasty timing-dependent bugs! Detection & Recovery • Typically very expensive to kill / checkpoint processes Avoidance: steer around deadlock • Requires knowledge of everything an application will request • Expensive to perform on each scheduling event
  • 14. Hope you enjoy & learn something  Special Thanks to : Philip Godfrey CS 241 University of Illinois Fahad Wazir (Little Brother) , kamran Shah & Mian Abdul PRESTON Thursday , August 09, 2012 University