wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Deadlocks

profile
AARON Dsouza
Aug 13, 2024
0 Likes
0 Discussions
82 Reads

Deadlock

 a deadlock is if 2 processes are waiting for some event to happen and that event never

takes place

eg. if I want to open an account in the bank to receive money but bank requires a minimum

deposit to open an account but I will only deposit the money when I get it from the transfer

that is an example of deadlock

in more technical terms

if process 1 locks resource r1 and requires r2 but process2 has locked r2 and requires r1

here atleast one of the processes need to release 1 resource to avoid the deadlock

There are 4 necessary conditions for deadlock:  mutual exclusion

 no preemption

 hold and wait  circular wait

1.Mutual exclusion: all the resources must be used by all the processes in a mutually

exclusive manner interleaving is not allowed I.e only one process can hold 1 resource at a

time

2.no preemption: if one process(p1) going on and another process(p2) requires the p1

resource, p1 should not release its resources and hold it because there should not be any

priority system involved and resources should not be switched forcefully only their

respective process can release it

3.Hold and wait: any resources that are currently held by a process should not be released

and that process can require for more resources

4. circular wait: if p1 has r1 and its requesting for r2 and p2 has r2 and its requesting for r1

here both the processes have locked each others resources and therefore its in a circular

manner. Deadlock prevention

1. To avoid mutual exclusion we must use resource in such a way that they can be shared

or the system can handle without exclusive locks

2. To avoid hold and wait the process must require all resources at once if resources are

allocated all must be else none or if additional resource is requested the process must

release all the other resource

3. To avoid preemption the process should release all the resource it currently uses

4. To avoid the circular wait the process must be assigned resources linearly or according

to a hierarchy of priority


Comments ()


Sign in

Read Next

Yoga in INDIA and ABROAD

Blog banner

Why Extreme Opinions Are Rising: Psychological Insights into Society’s Divides

Blog banner

What is Data, Information and Knowledge?

Blog banner

Scheduling in Operating Systems

Blog banner

Threads and concurrency

Blog banner

The Chapped Lips and Dry Mouth Trap: The Sneaky Reason Cavities Spike in Winter

Blog banner

Deadlock in Operating System

Blog banner

The Khan mehtab transforming the modular switches

Blog banner

Multiprocessor

Blog banner

The Dark Web: A Breeding Ground for Cybercriminals – How to Guard Against Threats

Blog banner

The art of being alone

Blog banner

Annual Day Preparation for Toddlers: What Helps and What to Avoid

Blog banner

Indian Culture and Tradition

Blog banner

VIRUS

Blog banner

Why is ITSM important in IT organization?

Blog banner

Synchronization

Blog banner

Top Career Paths After a B.Com Degree in Mumbai: What’s Next for You?

Blog banner

Jira service Management

Blog banner

Interrupts in OS

Blog banner

Microsoft Windows Overview

Blog banner

The Five Steps of Data Science

Blog banner

HUBSPOT

Blog banner

Data Security must be your Priority!

Blog banner

Unlocking the Secrets: Basic Operations of Computer Forensic Laboratories

Blog banner

Solitary Play Activities for Preschoolers: Types and Benefits

Blog banner

Emotional Resilience and Psychological Flexibility: The Hidden Foundation of Mental Health Well-being

Blog banner

Security Issues and Countermeasures

Blog banner

Challenges and risks in service operations

Blog banner

5 ways to save money on catering services in Mumbai

Blog banner

Multiprocessor and Multicore Organization

Blog banner

Business Intelligence v/s Big Data

Blog banner

Diwali

Blog banner

Memory management and virtual memory

Blog banner

INTERNET

Blog banner

DMZ: Your Secret Weapon for Data Security

Blog banner

Cryptanalysis tool

Blog banner

OS assignment 3

Blog banner

ODOO

Blog banner

THE ACTORS LIFE

Blog banner

Maharashtrian culture: Tradition, Art, Food

Blog banner

How Preschool Annual Day Shapes Confidence, Emotions, and Growth

Blog banner

Deadlock

Blog banner