wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Deadlocks

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

Modern Operating System

Blog banner

Processes: Process Description and Control.

Blog banner

Mendeley (management software)

Blog banner

Best Time to Visit Arcadia, Florida & Why Oak Tree Hotel Is Always Ready

Blog banner

Bharat Maps

Blog banner

Intrusion Detection System

Blog banner

Developments in Modern Operating Systems

Blog banner

Virtual Machine

Blog banner

Emailing the merger document

Blog banner

Kafka - A Framework

Blog banner

Android Application Components and Activity Lifecycle

Blog banner

Affiliate Marketing V/S Influencer Marketing

Blog banner

SECURITY RISKS OF REMOTE WORKING

Blog banner

CYBER FORENCIS: PAST, PRESENT AND FUTURE.

Blog banner

Dudhasagar waterfall ?

Blog banner

Smartsheet

Blog banner

Cyber Security Control

Blog banner

Mail merge

Blog banner

Is It Too Late to Straighten My Teeth as an Adult?

Blog banner

Introduction to Data Science: Life Cycle & Applications

Blog banner

Emotional Intelligence in Children: Why It Is as Important as Academics

Blog banner

Operating system

Blog banner

Threads Concurrency: Mutual Exclusion and Synchronization

Blog banner

Which Smartphone Company Has the Largest Market Share in India?

Blog banner

Understanding Input Based Keylogger Activation Systems: Risks and Mitigation

Blog banner

Financial Stress and Mental Health

Blog banner

Cryptanalysis tool

Blog banner

What is service level Agreement?

Blog banner

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

Blog banner

World’s rarest passport owned by 500 people.

Blog banner

Texting is actually better than talking in person

Blog banner

Biometric Authentication and Privacy: Balancing Ethical Concerns

Blog banner

Memory Management

Blog banner

It's all about our Brain.- The Brain Metaphor

Blog banner

Blockchain

Blog banner

IP Address

Blog banner

OPERATING SYSTEM OBJECTIVES AND FUNCTIONS

Blog banner

Raid and levels of raid.

Blog banner

How to invest in Indian Stock Market ? ~ Tutorial 1

Blog banner

What makes Nugget RC Racing Florida’s Most Exciting Racing Events?

Blog banner

Pro-Tips On How To Keep your Foot Healthy

Blog banner

What Your Music Taste Reveals About Your Personality

Blog banner