wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Deadlock in operating system

profile
Khushi Balgi
Aug 14, 2024
0 Likes
0 Discussions
147 Reads

What is Deadlock?

Deadlock is a situation in computing where two or more processes are unable to proceed because each is waiting for the other to release resources. Key concepts include mutual exclusion, resource holding, circular wait, and no preemption.


Consider an example when two trains are coming toward each other on the same track and there is only one track, none of the trains can move once they are in front of each other. This is a practical example of deadlock.


How Does Deadlock occur in the Operating System?

Before going into detail about how deadlock occurs in the Operating System, let’s first discuss how the Operating System uses the resources present. A process in an operating system uses resources in the following way.


Requests a resource

Use the resource

Releases the resource


A situation occurs in operating systems when there are two or more processes that hold some resources and wait for resources held by others. For example,Process 1 is holding Resource 1 and waiting for resource 2 which is acquired by process 2, and process 2 is waiting for resource 1.


Necessary Conditions for Deadlock in OS

Deadlock can arise if the following four conditions hold simultaneously (Necessary Conditions)


1.Mutual Exclusion: Two or more resources are non-shareable (Only one process can use at a time).

2.Hold and Wait: A process is holding at least one resource and waiting for resources.

3.No Preemption: A resource cannot be taken from a process unless the process releases the resource.

4.Circular Wait: A set of processes waiting for each other in circular form.


What is Deadlock Detection?

Deadlock detection is a process in computing where the system checks if there are any sets of processes that are stuck waiting for each other indefinitely, preventing them from moving forward. In simple words, deadlock detection is the process of finding out whether any process are stuck in loop or not.



Comments ()


Sign in

Read Next

Socket Programming in Java

Blog banner

Memory Management

Blog banner

Soak knowledge and level up your intellectual potential!!!

Blog banner

10 Reasons to Date a South Indian Girl

Blog banner

PROCESS CONTROL BLOCK IN OS

Blog banner

Exploring Human Factors in Cyber Forensics Investigations.

Blog banner

RSA (Rivest-Shamir-Adelman) Algorithm

Blog banner

Understanding Endometriosis and Its Psychological Impact on Quality of Life

Blog banner

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

Blog banner

Dr. Venkadavarahan

Blog banner

SNAPCHAT

Blog banner

Functions of Operating System

Blog banner

Why Kanye West (Now Ye) is the GOAT: A Legacy Beyond Music

Blog banner

Buffer Overflow

Blog banner

Multicore and Multithreading

Blog banner

What are the different types of E-mail crime and process of email forensic?

Blog banner

Deadlock

Blog banner

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

Blog banner

KASHMIR TRIPS

Blog banner

Uniprocessor scheduling

Blog banner

RAID

Blog banner

Virtual Memory

Blog banner

How to Manage Employees and Tasks in One System (Without Excel)

Blog banner

Understanding Input Based Keylogger Activation Systems: Risks and Mitigation

Blog banner

Starvation

Blog banner

Philadelphia Experiment : Was it real?

Blog banner

Social Engineering

Blog banner

Indian Culture and Tradition

Blog banner

The khan mehtab transforming the modular switches company

Blog banner

Multiprocessor and Multicore Organization

Blog banner

Firewall

Blog banner

Raising mental health burden: A global and Indian perspective

Blog banner

Security Issues and Countermeasures

Blog banner

Sensory Play for Toddlers: Boosting Curiosity Through Touch, Sound, and Colour

Blog banner

10 Signs That Prove YOU are his FIRST priority.

Blog banner

Life of a 2020-2021 student

Blog banner

Security in Operating Systems

Blog banner

Direct Memory Access

Blog banner

Operating system

Blog banner

Pandas Matrix Applications

Blog banner

Skills An Ethical Hacker Must Have

Blog banner

Top 5 Tech Innovations of 2018

Blog banner