wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Deadlocks

profile
AARON Dsouza
Aug 13, 2024
0 Likes
0 Discussions
81 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

'Positivity in life'

Blog banner

Severe landslides continue to cause concern in Joshimath, Uttarakhand

Blog banner

Threads

Blog banner

Ethical Hacking

Blog banner

How GIS in Agriculture Eliminates Guesswork

Blog banner

The Difference Between Plaque and Tartar Explained Simply

Blog banner

Evolution of operating system

Blog banner

What is Packet Filtering?

Blog banner

The Role of Fibre in Everyday Nutrition and Digestive Health

Blog banner

Expressing and Measuring Risk (Risk Management)

Blog banner

Service transistion under difficult conditions

Blog banner

Data Visualization – Importance and tools (Tableau, Power BI)

Blog banner

Modern Operating System

Blog banner

Why Moms Are Choosing Customised School Accessories Over Generic Products

Blog banner

Session Hijacking

Blog banner

How Laughing Gas Makes Your Dental Visit So Much Easier

Blog banner

FIREWALL

Blog banner

Security issues

Blog banner

COMPUTER FORENSICS AND GRAPHICS

Blog banner

Digital Footprints An Emerging Dimension of Digital Inequality

Blog banner

Risk mitigation and management

Blog banner

Deming’s Process

Blog banner

Rules and Regulations of Networking: "Standards and Protocols" - Part 2

Blog banner

LIMITED EDITION

Blog banner

The Psychology of Diversity, Equity & Inclusion: How Inclusive Workplaces Boost Productivity

Blog banner

Jira Software

Blog banner

Caching windows

Blog banner

Uniprocessor Scheduling

Blog banner

semaphores

Blog banner

HOW CAN SOCIAL MEDIA MAKE YOU HAPPIER?

Blog banner

OS- Assignnment 1

Blog banner

A Weekend of Wildlife, Rivers, and Relaxation in Southwest Florida

Blog banner

My First Trek - Sondai, Karjat - Shoaib Malik

Blog banner

Modern OS

Blog banner

Virtualization

Blog banner

Zomato's Secret Digital Marketing Techniques!

Blog banner

A-B-C of Networking: Part-2 (Components)

Blog banner

Cyber Security Standards

Blog banner

Service Operations Principles

Blog banner

Festive Ethnic Wear Guide: Patola-Inspired Looks for Every Celebration

Blog banner

FRIENDSHIP

Blog banner

How Cyber Forensics help prevent Crimes

Blog banner