wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Deadlock

profile
Prishi Jain
Aug 16, 2024
1 Like
0 Discussions
185 Reads

A deadlock in an operating system is a situation where a set of processes become stuck, unable to proceed because each process is waiting for a resource that another process in the same set is holding. Since none of the processes can proceed until another releases its resources, they are in a state of perpetual waiting, leading to a deadlock.

Key Conditions for Deadlock:

A deadlock can occur if the following four conditions hold simultaneously:

  1. Mutual Exclusion: At least one resource must be held in a non-shareable mode, meaning only one process can use the resource at a time.
  2. Hold and Wait: A process holding at least one resource is waiting to acquire additional resources that are currently being held by other processes.
  3. No Preemption: A resource cannot be forcibly removed from a process holding it; it can only be released voluntarily by the process holding it.
  4. Circular Wait: A set of processes exist where each process is waiting for a resource that the next process in the chain holds, forming a circular chain of dependencies.

Example Scenario:

Imagine two processes, P1 and P2, and two resources, R1 and R2. Suppose:

  • P1 holds R1 and requests R2.
  • P2 holds R2 and requests R1.

In this situation, P1 and P2 are waiting on each other to release the resources, leading to a deadlock.

Deadlock Handling Strategies:

Operating systems handle deadlocks using one of the following approaches:

  1. Deadlock Prevention: Ensuring that at least one of the four conditions for deadlock cannot occur.
  2. Deadlock Avoidance: Using algorithms (like the Banker’s algorithm) to ensure that the system never enters an unsafe state where a deadlock might occur.
  3. Deadlock Detection and Recovery: Allowing deadlocks to occur, but the system periodically checks for deadlocks and takes action to recover, such as terminating one or more processes involved in the deadlock.
  4. Ignoring the Problem: Some systems, especially simple ones or those where deadlocks are rare, choose to ignore the problem, hoping that deadlocks will not occur frequently.

Comments ()


Sign in

Read Next

Have You Explored India Yet?

Blog banner

How College Events Build Real-world Skills You Can’t Learn From Textbooks

Blog banner

How To Invest in Indian Stock Market For Beginners. ~ Tutorial 2 (NSDL And CSDL) Continued...

Blog banner

BITCOIN WALLET

Blog banner

Cyber Bullying - Neeta Vonkamuti

Blog banner

Kernel Memory Allocation In Linux.

Blog banner

From Websites To Super Apps For Digital User Experience

Blog banner

BUSINESS MODELS OF E COMMERCE

Blog banner

Some facts about Technology

Blog banner

Risk management in IT

Blog banner

Why You Should Not Use Free VPNs

Blog banner

MODERN OPERATING SYSTEM

Blog banner

Deadlock in Operating systems

Blog banner

The New Dr. Frankenstein who will perform first full head transplant

Blog banner

Virtual Memory - Explaination, Working, Steps

Blog banner

Search Marketing In 2026: From Keywords To Credibility And User Intent

Blog banner

Fitness regime by Deepesh

Blog banner

Principal of concurrency

Blog banner

Cache Memory

Blog banner

Celebrate Diwali the Delicious Way with Meal Maharaj Catering

Blog banner

IT Service Continuity Management

Blog banner

What is Packet Filtering?

Blog banner

Memory Management in an Operating System

Blog banner

Man In The Middle Attack

Blog banner

RACI model in IT services

Blog banner

Simple AI Symptom Diagnosis Using LISP – Rule-Based Expert System

Blog banner

Digital black market or dark net poses a national security threat?

Blog banner

Deadlock and Starvation

Blog banner

What is Amazon?

Blog banner

Improving the Accuracy of GPS and GNSS

Blog banner

Types of OS

Blog banner

Why is online marketing is important in current scenario

Blog banner

Ransomware

Blog banner

Virtual Memory

Blog banner

Data Mining

Blog banner

Hypothesis Testing in Data Science

Blog banner

Types of Malware in Cyber Security

Blog banner

Hacking

Blog banner

URL vs Domain

Blog banner

I/O Buffering

Blog banner

An Approach To Spyware Detection And Removal

Blog banner

Cache memory

Blog banner