wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Deadlock

profile
adi undefined
Aug 14, 2024
0 Likes
0 Discussions
79 Reads

Deadlock :

1)  Dead lock is a situation where a group of processes get stuck because each one is wait for another task to complete .

 

2)  Imagine two students, Adi and Dia, sitting at a table in a classroom. Each of them needs both a pencil and an eraser to complete their homework. However, there’s only one pencil and one eraser available on the table.

 

How does deadlock happens ?

Dead lock happens when all the four condition are present

1)  Mutual Exclusion : It means that some resources in the system cannot be shared .

Eg :- If there is one printer , and process related to printer is two , here one process will wait for another to finish its process.

2)  Hold and Wait : Processes that already have some resources and they are requesting for additional ones .

Eg:- Imagine a person holding a pencil and then request for a piece of paper . They don’t let go pencil while waiting for paper.

3)  No Preemption : Its states that a resources cannot be taken away from a process until the process releases the resource.

Eg : If someone is using computer , someone else cannot take it unless it is free.

4)  Circular Wait :  In this the process is waiting from the resources that are held by the next process .

Eg :- Suppose process A is waiting for resource which is held by process B , B is waiting for resource which is held by C & process C is waiting for resource that is held by process A . This creates a circle , and no process can proceed because they’re all waiting on each other.

Real Life Example :

Imagine you and your three friends—Adi, Dia, Tanisha, and Aaron—are playing a game. In this game, there are four unique objects: a ball, a book, a key, and a coin. To win, each of you needs to collect two specific objects. The catch is that each of you already has one object, and you need another specific object that someone else has.

Here’s how the situation unfolds:

  • Adi has the ball and needs the book.
  • Dia has the book and needs the key.
  • Tanisha has the key and needs the coin.
  • Aaron has the coin and needs the ball.

How to deal with deadlock :

There are few ways to deal with deadlock :

1)  Deadlock Prevention: The system is designed so that at least one of the four conditions mentioned above cannot occur.

2)  Deadlock Avoidance: The system carefully manages resources and checks whether giving a resource will lead to a deadlock. If it leads to deadlock, it won’t grant the resource.

3)  Deadlock Detection and Recovery: The system regularly checks for deadlocks. If a deadlock is detected, it might take some actions, like terminating some processes or forcibly taking resources away, to break the deadlock.

4)  Ignoring Deadlock: Sometimes, systems ignores the problem, especially if deadlocks are rare. This is known as "ostrich algorithm" because the system "buries its head in the sand" and hopes deadlocks don’t happen.


Comments ()


Sign in

Read Next

From Canoeing to Camping: The Perfect Nature Escape Near Arcadia

Blog banner

The Future of Cybersecurity: Trends, Challenges, and Strategies

Blog banner

Digital Life And Mental Health: A Psychological Perspective in the Modern World

Blog banner

How to Prepare Your Child for Their First Day of School?

Blog banner

City2Surf & Spring Fitness Recovery Guide: How Sports Drinks Silently Damage Enamel

Blog banner

Some web vulnerabilities

Blog banner

Capacity management in ITSM

Blog banner

MODERN OPERATING SYSTEM

Blog banner

MoSCoW METHOD IN DATA SCIENCE

Blog banner

How social media affect

Blog banner

Phishing Isn't Getting Smarter — You're Just Seeing More of It

Blog banner

I/O Management and Disk Scheduling

Blog banner

How User Data Shapes Personalised Campaigns

Blog banner

Deadlock

Blog banner

Workplace mental health: A Psychological Perspective on Employee Well-being and Organizational Growth

Blog banner

Big Data

Blog banner

Remote Work in 2026

Blog banner

Puri Jagannath temple

Blog banner

Why Peace River Is Florida’s Most Underrated Outdoor Adventure Destination?

Blog banner

What are Tenders its various types

Blog banner

Short note on expert system

Blog banner

10 Alien Encounters and Abduction Stories

Blog banner

Can a Water Flosser Replace Manual Flossing? Here’s What Dentists Say

Blog banner

Analysis of Digital Evidence In Identity Theft Investigations

Blog banner

Internet: The Vast Ocean Of Knowledge.

Blog banner

Modern Operating Systems

Blog banner

The Rich Heritage Of Patola Sarees: Gujarat’s Timeless Weaving Art

Blog banner

BharatPe

Blog banner

Virtual Machine's

Blog banner

Global versus Indian Mental Health Differences

Blog banner

Expressing and Measuring Risk (Risk Management)

Blog banner

Monday. com App

Blog banner

Linker

Blog banner

Fault Tolerance

Blog banner

Article on Team Work

Blog banner

GIS Topography

Blog banner

Busted : Common Web Security Myths

Blog banner

MEMORY MANAGEMENT (techniques)

Blog banner

The Lunchbox That Came Back Untouched — How to Handle a Fussy Eater at Preschool Age

Blog banner

Memory Management

Blog banner

Cyber Forensics

Blog banner

A Deep Dive

Blog banner